From 8da650b456d8fd744abf401a67535acbdd6c22c7 Mon Sep 17 00:00:00 2001 From: Michael Haggerty Date: Fri, 7 Sep 2012 00:40:57 +0200 Subject: [PATCH] t0060: move tests of real_path() from t0000 to here Suggested by: Johannes Sixt Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- t/t0000-basic.sh | 18 ------------------ t/t0060-path-utils.sh | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index ccb5435b2..ae6a3f077 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -450,24 +450,6 @@ test_expect_success 'update-index D/F conflict' ' test $numpath0 = 1 ' -test_expect_success SYMLINKS 'real path works as expected' ' - mkdir first && - ln -s ../.git first/.git && - mkdir second && - ln -s ../first second/other && - mkdir third && - dir="$(cd .git; pwd -P)" && - dir2=third/../second/other/.git && - test "$dir" = "$(test-path-utils real_path $dir2)" && - file="$dir"/index && - test "$file" = "$(test-path-utils real_path $dir2/index)" && - basename=blub && - test "$dir/$basename" = "$(cd .git && test-path-utils real_path "$basename")" && - ln -s ../first/file .git/syml && - sym="$(cd first; pwd -P)"/file && - test "$sym" = "$(test-path-utils real_path "$dir2/syml")" -' - test_expect_success 'very long name in the index handled sanely' ' a=a && # 1 diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh index 53cf1f8dc..c8db144c3 100755 --- a/t/t0060-path-utils.sh +++ b/t/t0060-path-utils.sh @@ -139,4 +139,23 @@ test_expect_success 'strip_path_suffix' ' test c:/msysgit = $(test-path-utils strip_path_suffix \ c:/msysgit/libexec//git-core libexec/git-core) ' + +test_expect_success SYMLINKS 'real path works as expected' ' + mkdir first && + ln -s ../.git first/.git && + mkdir second && + ln -s ../first second/other && + mkdir third && + dir="$(cd .git; pwd -P)" && + dir2=third/../second/other/.git && + test "$dir" = "$(test-path-utils real_path $dir2)" && + file="$dir"/index && + test "$file" = "$(test-path-utils real_path $dir2/index)" && + basename=blub && + test "$dir/$basename" = "$(cd .git && test-path-utils real_path "$basename")" && + ln -s ../first/file .git/syml && + sym="$(cd first; pwd -P)"/file && + test "$sym" = "$(test-path-utils real_path "$dir2/syml")" +' + test_done -- 2.26.2