From e6ec2b6a23a364de76cd8868d4df20627264eb45 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Thu, 30 Dec 2010 21:51:53 +0100 Subject: [PATCH] Fix expected values of setup tests on Windows On Windows, bash stores absolute path names in shell variables in POSIX format that begins with a slash, rather than in drive-letter format; such a value is converted to the latter format when it is passed to a non-MSYS program such as git. When an expected test value is constructed, it must contain the value that will be produced by git, which will be in the drive-letter format. But TRASH_DIRECTORY is in POSIX format. Fix this by using $(pwd), which produces drive-letter format since 4114156a (Tests on Windows: $(pwd) must return Windows-style paths). The change in t1510 is a straight seach-and-replace, except for the first hunk of the diff. Signed-off-by: Johannes Sixt Signed-off-by: Junio C Hamano --- t/t1501-worktree.sh | 2 +- t/t1510-repo-setup.sh | 2333 +++++++++++++++++++++-------------------- 2 files changed, 1168 insertions(+), 1167 deletions(-) diff --git a/t/t1501-worktree.sh b/t/t1501-worktree.sh index f072a8ed4..da6252b11 100755 --- a/t/t1501-worktree.sh +++ b/t/t1501-worktree.sh @@ -343,7 +343,7 @@ test_expect_success 'make_relative_path handles double slashes in GIT_DIR' ' test_expect_success 'relative $GIT_WORK_TREE and git subprocesses' ' GIT_DIR=repo.git GIT_WORK_TREE=repo.git/work \ test-subprocess --setup-work-tree rev-parse --show-toplevel >actual && - echo "$TRASH_DIRECTORY/repo.git/work" >expected && + echo "$(pwd)/repo.git/work" >expected && test_cmp expected actual ' diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh index c3798ce17..e9c451cc5 100755 --- a/t/t1510-repo-setup.sh +++ b/t/t1510-repo-setup.sh @@ -82,14 +82,15 @@ test_repo() { test_expect_success '#0: setup' ' sane_unset GIT_DIR GIT_WORK_TREE && mkdir 0 0/sub && - cd 0 && git init && cd .. + (cd 0 && git init) && + here=$(pwd) ' test_expect_success '#0: at root' ' cat >0/expected <0/sub/expected <1/expected <1/sub/expected <2/expected <2/sub/expected <2/expected <2/sub/expected <3/expected <3/expected <3/expected <3/expected <3/sub/sub/expected <3/sub/sub/expected <3/sub/expected <3/sub/sub/expected <3/expected <3/expected <3/expected <3/expected <3/sub/sub/expected <3/sub/sub/expected <3/sub/sub/expected <3/sub/sub/expected <3/expected <3/expected <3/expected <3/expected <3/sub/sub/expected <3/sub/sub/expected <3/sub/sub/expected <3/sub/sub/expected <4/expected <4/sub/expected <5/expected <5/sub/expected <6/expected <6/expected <6/expected <6/expected <6/sub/sub/expected <6/sub/sub/expected <6/sub/expected <6/sub/sub/expected <6/expected <6/expected <6/expected <6/expected <6/sub/sub/expected <6/sub/sub/expected <6/sub/sub/expected <6/sub/sub/expected <6/expected <6/expected <6/expected <6/expected <6/sub/sub/expected <6/sub/sub/expected <6/sub/sub/expected <6/sub/sub/expected <7/expected <7/expected <7/expected <7/expected <7/sub/sub/expected <7/sub/sub/expected <7/sub/expected <7/sub/sub/expected <7/expected <7/expected <7/expected <7/expected <7/sub/sub/expected <7/sub/sub/expected <7/sub/sub/expected <7/sub/sub/expected <7/expected <7/expected <7/expected <7/expected <7/sub/sub/expected <7/sub/sub/expected <7/sub/sub/expected <7/sub/sub/expected <8/expected <8/sub/expected <9/expected <9/sub/expected <10/expected <10/sub/expected <10/expected <10/sub/expected <11/expected <11/expected <11/expected <11/expected <11/sub/sub/expected <11/sub/sub/expected <11/sub/expected <11/sub/sub/expected <11/expected <11/expected <11/expected <11/expected <11/sub/sub/expected <11/sub/sub/expected <11/sub/sub/expected <11/sub/sub/expected <11/expected <11/expected <11/expected <11/expected <11/sub/sub/expected <11/sub/sub/expected <11/sub/sub/expected <11/sub/sub/expected <12/expected <12/sub/expected <13/expected <13/sub/expected <14/expected <14/expected <14/expected <14/expected <14/sub/sub/expected <14/sub/sub/expected <14/sub/expected <14/sub/sub/expected <14/expected <14/expected <14/expected <14/expected <14/sub/sub/expected <14/sub/sub/expected <14/sub/sub/expected <14/sub/sub/expected <14/expected <14/expected <14/expected <14/expected <14/sub/sub/expected <14/sub/sub/expected <14/sub/sub/expected <14/sub/sub/expected <15/expected <15/expected <15/expected <15/expected <15/sub/sub/expected <15/sub/sub/expected <15/sub/expected <15/sub/sub/expected <15/expected <15/expected <15/expected <15/expected <15/sub/sub/expected <15/sub/sub/expected <15/sub/sub/expected <15/sub/sub/expected <15/expected <15/expected <15/expected <15/expected <15/sub/sub/expected <15/sub/sub/expected <15/sub/sub/expected <15/sub/sub/expected <16/.git/expected <16/.git/wt/expected <16/.git/wt/sub/expected <16/.git/expected <16/.git/wt/expected <16/.git/wt/sub/expected <16/expected <16/sub/expected <17/.git/expected <17/.git/wt/expected <17/.git/wt/sub/expected < #16.2 (with warnings perhaps) test_expect_success '#17.2: setup' ' - git config --file="$TRASH_DIRECTORY/17/.git/config" core.bare true + git config --file="$here/17/.git/config" core.bare true ' test_expect_success '#17.2: at .git' ' cat >17/.git/expected <17/.git/wt/expected <17/.git/wt/sub/expected <17/expected <17/sub/expected <18/expected <18/expected <18/sub/expected <18/sub/expected <19/expected <19/expected <19/expected <19/expected <19/sub/sub/expected <19/sub/sub/expected <19/sub/expected <19/sub/sub/expected <19/expected <19/expected <19/expected <19/expected <19/sub/sub/expected <19/sub/sub/expected <19/sub/sub/expected <19/sub/sub/expected <19/expected <19/expected <19/expected <19/expected <19/sub/sub/expected <19/sub/sub/expected <19/sub/sub/expected <19/sub/sub/expected <20/.git/expected <20/.git/wt/expected <20/.git/wt/sub/expected < #16.2 test_expect_success '#20.2: setup' ' - git config --file="$TRASH_DIRECTORY/20/.git/config" core.bare true + git config --file="$here/20/.git/config" core.bare true ' test_expect_success '#20.2: at .git' ' cat >20/.git/expected <20/.git/wt/expected <20/.git/wt/sub/expected <20/expected <20/sub/expected <21/.git/expected <21/.git/wt/expected <21/.git/wt/sub/expected < #20.2 test_expect_success '#21.2: setup' ' - git config --file="$TRASH_DIRECTORY/21/.git/config" core.bare true + git config --file="$here/21/.git/config" core.bare true ' test_expect_success '#21.2: at .git' ' cat >21/.git/expected <21/.git/wt/expected <21/.git/wt/sub/expected <21/expected <21/sub/expected <22/.git/expected <22/.git/expected <22/.git/expected <22/.git/expected <22/.git/sub/expected <22/.git/sub/expected <22/.git/sub/expected <22/.git/sub/expected <22/.git/expected <22/.git/expected <22/.git/expected <22/.git/expected <22/.git/sub/expected <22/.git/sub/expected <22/.git/sub/expected <22/.git/sub/expected <22/.git/expected <22/.git/expected <22/.git/expected <22/.git/expected <22/.git/sub/expected <22/.git/sub/expected <22/.git/sub/expected <22/.git/sub/expected <23/expected <23/expected <23/expected <23/expected <23/sub/sub/expected <23/sub/sub/expected <23/sub/expected <23/sub/sub/expected <23/expected <23/expected <23/expected <23/expected <23/sub/sub/expected <23/sub/sub/expected <23/sub/sub/expected <23/sub/sub/expected <23/expected <23/expected <23/expected <23/expected <23/sub/sub/expected <23/sub/sub/expected <23/sub/sub/expected <23/sub/sub/expected <24/expected <24/sub/expected <25/expected <25/sub/expected <26/expected <26/expected <26/sub/expected <26/sub/expected <27/expected <27/expected <27/expected <27/expected <27/sub/sub/expected <27/sub/sub/expected <27/sub/expected <27/sub/sub/expected <27/expected <27/expected <27/expected <27/expected <27/sub/sub/expected <27/sub/sub/expected <27/sub/sub/expected <27/sub/sub/expected <27/expected <27/expected <27/expected <27/expected <27/sub/sub/expected <27/sub/sub/expected <27/sub/sub/expected <27/sub/sub/expected <28/expected <28/sub/expected <29/expected <29/sub/expected <31/expected <31/expected <31/expected <31/expected <31/sub/sub/expected <31/sub/sub/expected <31/sub/expected <31/sub/sub/expected <31/expected <31/expected <31/expected <31/expected <31/sub/sub/expected <31/sub/sub/expected <31/sub/sub/expected <31/sub/sub/expected <31/expected <31/expected <31/expected <31/expected <31/sub/sub/expected <31/sub/sub/expected <31/sub/sub/expected <31/sub/sub/expected <