summaryrefslogtreecommitdiff
path: root/fixup-builtins
diff options
context:
space:
mode:
authorLibravatar Nguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-02-14 22:44:44 +0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-02-16 08:55:56 -0800
commit72ec8ba6dddbe2c53500d35d7ed343c153874fc6 (patch)
treee8082e86783f0941dce1706b43885b66e37fe750 /fixup-builtins
parentMove offset_1st_component() to path.c (diff)
downloadtgif-72ec8ba6dddbe2c53500d35d7ed343c153874fc6.tar.xz
Support working directory located at root
Git should work regardless where the working directory is located, even at root. This patch fixes two places where it assumes working directory always have parent directory. In setup_git_directory_gently(), when Git goes up to root and finds .git there, it happily sets worktree to "" instead of "/". In prefix_path(), loosen the outside repo check a little bit. Usually when a path XXX is inside worktree /foo, it must be either "/foo", or "/foo/...". When worktree is simply "/", we can safely ignore the check: we have a slash at the beginning already. Not related to worktree, but also set gitdir correctly if a bare repo is placed (insanely?) at root. Thanks João Carlos Mendes Luís for pointing out this problem. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fixup-builtins')
0 files changed, 0 insertions, 0 deletions