t0060: move tests of real_path() from t0000 to here

Suggested by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Michael Haggerty committed Sep 7, 2012 at 00:40 UTC 8da650b456d8fd744abf401a67535acbdd6c22c7
2 files changed +19 -18
t/t0000-basic.sh
-18
@@ -450,24 +450,6 @@ test_expect_success 'update-index D/F conflict' '
450 test $numpath0 = 1
451 '
452
453 -test_expect_success SYMLINKS 'real path works as expected' '
454 - mkdir first &&
455 - ln -s ../.git first/.git &&
456 - mkdir second &&
457 - ln -s ../first second/other &&
458 - mkdir third &&
459 - dir="$(cd .git; pwd -P)" &&
460 - dir2=third/../second/other/.git &&
461 - test "$dir" = "$(test-path-utils real_path $dir2)" &&
462 - file="$dir"/index &&
463 - test "$file" = "$(test-path-utils real_path $dir2/index)" &&
464 - basename=blub &&
465 - test "$dir/$basename" = "$(cd .git && test-path-utils real_path "$basename")" &&
466 - ln -s ../first/file .git/syml &&
467 - sym="$(cd first; pwd -P)"/file &&
468 - test "$sym" = "$(test-path-utils real_path "$dir2/syml")"
469 -'
470 -
453 test_expect_success 'very long name in the index handled sanely' '
454
455 a=a && # 1
t/t0060-path-utils.sh
+19
@@ -139,4 +139,23 @@ test_expect_success 'strip_path_suffix' '
139 test c:/msysgit = $(test-path-utils strip_path_suffix \
140 c:/msysgit/libexec//git-core libexec/git-core)
141 '
142 +
143 +test_expect_success SYMLINKS 'real path works as expected' '
144 + mkdir first &&
145 + ln -s ../.git first/.git &&
146 + mkdir second &&
147 + ln -s ../first second/other &&
148 + mkdir third &&
149 + dir="$(cd .git; pwd -P)" &&
150 + dir2=third/../second/other/.git &&
151 + test "$dir" = "$(test-path-utils real_path $dir2)" &&
152 + file="$dir"/index &&
153 + test "$file" = "$(test-path-utils real_path $dir2/index)" &&
154 + basename=blub &&
155 + test "$dir/$basename" = "$(cd .git && test-path-utils real_path "$basename")" &&
156 + ln -s ../first/file .git/syml &&
157 + sym="$(cd first; pwd -P)"/file &&
158 + test "$sym" = "$(test-path-utils real_path "$dir2/syml")"
159 +'
160 +
161 test_done