summaryrefslogtreecommitdiff
path: root/builtin/clone.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-02-14 20:57:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-02-14 20:57:18 (GMT)
commit0364bb135e285d4118b69979ade3078fab50e08a (patch)
tree25b765f0b43fd761ba42815a4eae9df3f4bd5545 /builtin/clone.c
parent10439fc0effb194e1ce2cd4db8fbd69cfaf23656 (diff)
parentb3256eb8b35937192e85725d0c2bcb422295790c (diff)
downloadgit-0364bb135e285d4118b69979ade3078fab50e08a.zip
git-0364bb135e285d4118b69979ade3078fab50e08a.tar.gz
git-0364bb135e285d4118b69979ade3078fab50e08a.tar.bz2
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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index b15fccb..7559f62 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) {