summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-02-21 23:13:16 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-02-21 23:13:16 (GMT)
commit0cfba96121b9617668a7b4ad18e3ae3a19dc8755 (patch)
tree4c148d3a45c5af2e105b92c8cb2e497052f4c877 /builtin
parenta67c23544888761e940452f7533953b3c368456f (diff)
parentb3256eb8b35937192e85725d0c2bcb422295790c (diff)
downloadgit-0cfba96121b9617668a7b4ad18e3ae3a19dc8755.zip
git-0cfba96121b9617668a7b4ad18e3ae3a19dc8755.tar.gz
git-0cfba96121b9617668a7b4ad18e3ae3a19dc8755.tar.bz2
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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index 86db954..df8ae75 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) {