diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-02-21 15:13:16 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-02-21 15:13:16 -0800 |
commit | 0cfba96121b9617668a7b4ad18e3ae3a19dc8755 (patch) | |
tree | 4c148d3a45c5af2e105b92c8cb2e497052f4c877 /builtin | |
parent | a67c23544888761e940452f7533953b3c368456f (diff) | |
parent | b3256eb8b35937192e85725d0c2bcb422295790c (diff) | |
download | git-0cfba96121b9617668a7b4ad18e3ae3a19dc8755.tar.gz |
Merge branch 'jk/git-dir-lookup' into maint
* jk/git-dir-lookup:
standardize and improve lookup rules for external local repos
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/clone.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/clone.c b/builtin/clone.c index 86db954730..df8ae750dd 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -105,7 +105,7 @@ static const char *argv_submodule[] = { static char *get_repo_path(const char *repo, int *is_bundle) { - static char *suffix[] = { "/.git", ".git", "" }; + static char *suffix[] = { "/.git", "", ".git/.git", ".git" }; static char *bundle_suffix[] = { ".bundle", "" }; struct stat st; int i; @@ -115,7 +115,7 @@ static char *get_repo_path(const char *repo, int *is_bundle) path = mkpath("%s%s", repo, suffix[i]); if (stat(path, &st)) continue; - if (S_ISDIR(st.st_mode)) { + if (S_ISDIR(st.st_mode) && is_git_directory(path)) { *is_bundle = 0; return xstrdup(absolute_path(path)); } else if (S_ISREG(st.st_mode) && st.st_size > 8) { |