History

[gix-organize]: this version fails to detect any git repo

Sebastian Thiel committed 5 years ago

Commit 8802fa71 parent 20f76a51 file · +5 −5Browse files

Showing the changes to gitoxide-core/src (1 of 1 file). Show all

Unified · Split

gitoxide-core/src/organize.rs+5−5
@@ -30,11 +30,11 @@ where · 29 unmodified lines
3030 <P as Progress>::SubProgress: Sync,
3131 {
3232 progress.init(None, progress::count("filesystem items"));
33− fn is_repository(path: &Path) -> bool {
33+ fn is_repository(path: &Path) -> Option<git_repository::Kind> {
3434 if !(path.is_dir() && path.ends_with(".git")) {
35− return false;
35+ return None;
3636 }
37− path.join("HEAD").is_file() && path.join("config").is_file()
37+ git_repository::path::is_git(&path).ok()
3838 }
3939 fn into_workdir(git_dir: PathBuf) -> PathBuf {
4040 if git_repository::path::is_bare(&git_dir) {
@@ -67,8 +67,8 @@ where · 26 unmodified lines
6767 let mut found_bare_repo = false;
6868 for entry in siblings.iter_mut().flatten() {
6969 let path = entry.path();
70− if is_repository(&path) {
71− let is_bare = git_repository::path::is_bare(&path);
70+ if let Some(kind) = is_repository(&path) {
71+ let is_bare = kind.is_bare();
7272 entry.client_state = State { is_repo: true, is_bare };
7373 entry.read_children_path = None;
7474