summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1c64b48)
raw | patch | inline | side by side (parent: 1c64b48)
author | Phil Hord <phil.hord@gmail.com> | |
Tue, 4 Oct 2011 20:05:17 +0000 (16:05 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 4 Oct 2011 20:30:38 +0000 (13:30 -0700) |
The enter_repo() function is used to navigate into a .git
directory. It knows how to find standard alternatives (DWIM) but
it doesn't handle gitfiles created by git init --separate-git-dir.
This means that git-fetch and others do not work with repositories
using the separate-git-dir mechanism.
Teach enter_repo() to deal with the gitfile mechanism by resolving
the path to the redirected path and continuing tests on that path
instead of the found file.
Signed-off-by: Phil Hord <hordp@cisco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
directory. It knows how to find standard alternatives (DWIM) but
it doesn't handle gitfiles created by git init --separate-git-dir.
This means that git-fetch and others do not work with repositories
using the separate-git-dir mechanism.
Teach enter_repo() to deal with the gitfile mechanism by resolving
the path to the redirected path and continuing tests on that path
instead of the found file.
Signed-off-by: Phil Hord <hordp@cisco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
path.c | patch | blob | history |
index 01028f282630169c6e2e2a148ddfd017e851b38f..b6f71d1086981dc41bdbbc8954eccd9e9b719f98 100644 (file)
--- a/path.c
+++ b/path.c
static const char *suffix[] = {
".git/.git", "/.git", ".git", "", NULL,
};
+ const char *gitfile;
int len = strlen(path);
int i;
while ((1 < len) && (path[len-1] == '/'))
break;
}
}
- if (!suffix[i] || chdir(used_path))
+ if (!suffix[i])
+ return NULL;
+ gitfile = read_gitfile(used_path) ;
+ if (gitfile)
+ strcpy(used_path, gitfile);
+ if (chdir(used_path))
return NULL;
path = validated_path;
}