diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-02-14 12:57:18 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-02-14 12:57:18 -0800 |
commit | 0364bb135e285d4118b69979ade3078fab50e08a (patch) | |
tree | 25b765f0b43fd761ba42815a4eae9df3f4bd5545 /builtin/clone.c | |
parent | 10439fc0effb194e1ce2cd4db8fbd69cfaf23656 (diff) | |
parent | b3256eb8b35937192e85725d0c2bcb422295790c (diff) | |
download | git-0364bb135e285d4118b69979ade3078fab50e08a.tar.gz |
Merge branch 'jk/git-dir-lookup'
* jk/git-dir-lookup:
standardize and improve lookup rules for external local repos
Diffstat (limited to 'builtin/clone.c')
-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 b15fccb588..7559f62bc7 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -107,7 +107,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; @@ -117,7 +117,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) { |