Skip to content

Commit 8da650b

Browse files
mhaggergitster
authored andcommitted
t0060: move tests of real_path() from t0000 to here
Suggested by: Johannes Sixt <[email protected]> Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b521831 commit 8da650b

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

t/t0000-basic.sh

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -450,24 +450,6 @@ test_expect_success 'update-index D/F conflict' '
450450
test $numpath0 = 1
451451
'
452452

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-
471453
test_expect_success 'very long name in the index handled sanely' '
472454
473455
a=a && # 1

t/t0060-path-utils.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,23 @@ test_expect_success 'strip_path_suffix' '
139139
test c:/msysgit = $(test-path-utils strip_path_suffix \
140140
c:/msysgit/libexec//git-core libexec/git-core)
141141
'
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+
142161
test_done

0 commit comments

Comments
 (0)