Skip to content

Commit e6ec2b6

Browse files
j6tgitster
authored andcommitted
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 4114156 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2cf08b6 commit e6ec2b6

File tree

2 files changed

+1168
-1167
lines changed

2 files changed

+1168
-1167
lines changed

t/t1501-worktree.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ test_expect_success 'make_relative_path handles double slashes in GIT_DIR' '
343343
test_expect_success 'relative $GIT_WORK_TREE and git subprocesses' '
344344
GIT_DIR=repo.git GIT_WORK_TREE=repo.git/work \
345345
test-subprocess --setup-work-tree rev-parse --show-toplevel >actual &&
346-
echo "$TRASH_DIRECTORY/repo.git/work" >expected &&
346+
echo "$(pwd)/repo.git/work" >expected &&
347347
test_cmp expected actual
348348
'
349349

0 commit comments

Comments
 (0)