diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-02-14 22:44:44 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-02-16 08:55:56 -0800 |
commit | 72ec8ba6dddbe2c53500d35d7ed343c153874fc6 (patch) | |
tree | e8082e86783f0941dce1706b43885b66e37fe750 /fixup-builtins | |
parent | Move offset_1st_component() to path.c (diff) | |
download | tgif-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