diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-08-16 23:53:12 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-08-18 03:32:45 -0700 |
commit | da02ca508b842e61c71d920310ff30bbe0238993 (patch) | |
tree | 1df912cd8732c7fcd91b33a8b2b847b47dc484f7 /t/t2000-checkout-cache-clash.sh | |
parent | b6986d8a75812a003a1623e0f0dff93c4a026b44 (diff) | |
download | git-da02ca508b842e61c71d920310ff30bbe0238993.tar.gz |
check_path(): allow symlinked directories to checkout-index --prefix
Merlyn noticed that Documentation/install-doc-quick.sh no longer correctly
removes old installed documents when the target directory has a leading
path that is a symlink. It turns out that "checkout-index --prefix" was
broken by recent b6986d8 (git-checkout: be careful about untracked
symlinks, 2009-07-29).
I suspect has_symlink_leading_path() could learn the third parameter
(prefix that is allowed to be symlinked directories) to allow us to retire
a similar function has_dirs_only_path().
Another avenue of fixing this I considered was to get rid of base_dir and
base_dir_len from "struct checkout", and instead make "git checkout-index"
when run with --prefix mkdir the leading path and chdir in there. It
might be the best longer term solution to this issue, as the base_dir
feature is used only by that rather obscure codepath as far as I know.
But at least this patch should fix this breakage.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t2000-checkout-cache-clash.sh')
-rwxr-xr-x | t/t2000-checkout-cache-clash.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t2000-checkout-cache-clash.sh b/t/t2000-checkout-cache-clash.sh index f7e1a735ec..de3edb5d57 100755 --- a/t/t2000-checkout-cache-clash.sh +++ b/t/t2000-checkout-cache-clash.sh @@ -48,4 +48,13 @@ test_expect_success \ 'git checkout-index conflicting paths.' \ 'test -f path0 && test -d path1 && test -f path1/file1' +test_expect_success SYMLINKS 'checkout-index -f twice with --prefix' ' + mkdir -p tar/get && + ln -s tar/get there && + echo first && + git checkout-index -a -f --prefix=there/ && + echo second && + git checkout-index -a -f --prefix=there/ +' + test_done |