summaryrefslogtreecommitdiff
path: root/t/t4111-apply-subdir.sh
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2012-02-02 16:59:13 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-02-02 16:41:55 -0800
commitb3256eb8b35937192e85725d0c2bcb422295790c (patch)
tree80d4aae728c99ab97e2facf9f7ef895fba7d1479 /t/t4111-apply-subdir.sh
parentGit 1.7.8 (diff)
downloadtgif-b3256eb8b35937192e85725d0c2bcb422295790c.tar.xz
standardize and improve lookup rules for external local repos
When you specify a local repository on the command line of clone, ls-remote, upload-pack, receive-pack, or upload-archive, or in a request to git-daemon, we perform a little bit of lookup magic, doing things like looking in working trees for .git directories and appending ".git" for bare repos. For clone, this magic happens in get_repo_path. For everything else, it happens in enter_repo. In both cases, there are some ambiguous or confusing cases that aren't handled well, and there is one case that is not handled the same by both methods. This patch tries to provide (and test!) standard, sensible lookup rules for both code paths. The intended changes are: 1. When looking up "foo", we have always preferred a working tree "foo" (containing "foo/.git" over the bare "foo.git". But we did not prefer a bare "foo" over "foo.git". With this patch, we do so. 2. We would select directories that existed but didn't actually look like git repositories. With this patch, we make sure a selected directory looks like a git repo. Not only is this more sensible in general, but it will help anybody who is negatively affected by change (1) negatively (e.g., if they had "foo.git" next to its separate work tree "foo", and expect to keep finding "foo.git" when they reference "foo"). 3. The enter_repo code path would, given "foo", look for "foo.git/.git" (i.e., do the ".git" append magic even for a repo with working tree). The clone code path did not; with this patch, they now behave the same. In the unlikely case of a working tree overlaying a bare repo (i.e., a ".git" directory _inside_ a bare repo), we continue to treat it as a working tree (prefering the "inner" .git over the bare repo). This is mainly because the combination seems nonsensical, and I'd rather stick with existing behavior on the off chance that somebody is relying on it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4111-apply-subdir.sh')
0 files changed, 0 insertions, 0 deletions