1- use anyhow:: { bail , Result } ;
1+ use anyhow:: { Result , bail } ;
22use cmd_lib:: run_fun;
33use remote:: { ListRepos , Remote } ;
44use serde:: { Deserialize , Serialize } ;
@@ -205,16 +205,14 @@ pub fn check_uncommitted_changes(repo_path: &Path) -> Result<bool> {
205205 {
206206 Ok ( mut iter) => {
207207 // Check if there are any untracked files
208- for item in iter. by_ref ( ) {
209- if let Ok ( entry) = item {
210- // Check if this is an untracked file
211- if matches ! (
212- entry,
213- gix:: status:: index_worktree:: iter:: Item :: DirectoryContents { .. }
214- ) {
215- debug ! ( "Repository has untracked files: {}" , repo_path. display( ) ) ;
216- return Ok ( true ) ;
217- }
208+ for entry in iter. by_ref ( ) . flatten ( ) {
209+ // Check if this is an untracked file
210+ if matches ! (
211+ entry,
212+ gix:: status:: index_worktree:: iter:: Item :: DirectoryContents { .. }
213+ ) {
214+ debug ! ( "Repository has untracked files: {}" , repo_path. display( ) ) ;
215+ return Ok ( true ) ;
218216 }
219217 }
220218 }
@@ -399,15 +397,6 @@ impl Workspace {
399397 /// Search the workspace for local repos matching the given pattern.
400398 pub fn search ( & self , pattern : & RepoPattern ) -> Result < Vec < PathBuf > > {
401399 let repos = find_git_repositories ( & format ! ( "{}/{}" , self . path, pattern. full_path( ) ) ) ?;
402-
403- // Try each remote if there were no matches immediately
404- // if repos.len() == 0 {
405- // for remote in self.remotes.iter() {
406- // let repos = find_git_dir(&format!("{}/{}/{}", self.path, remote.name(), pattern.full_path()))?;
407- // if repos.len() == 0 {}
408- // }
409- // }
410-
411400 Ok ( repos)
412401 }
413402
@@ -651,7 +640,7 @@ impl Library {
651640 let dest = self . compute_library_key ( & repo_path) ;
652641
653642 // Verify the source .git directory exists
654- if ! std:: fs:: metadata ( & source) . is_ok ( ) {
643+ if std:: fs:: metadata ( & source) . is_err ( ) {
655644 bail ! ( "Repository .git directory not found: {}" , source) ;
656645 }
657646
@@ -677,7 +666,7 @@ impl Library {
677666 let source = self . compute_library_key ( & repo_path) ;
678667
679668 // Verify the library entry exists
680- if ! std:: fs:: metadata ( & source) . is_ok ( ) {
669+ if std:: fs:: metadata ( & source) . is_err ( ) {
681670 bail ! ( "Repository not found in library for path: {}" , repo_path) ;
682671 }
683672
0 commit comments