Skip to content

Commit eaf0551

Browse files
peffgitster
authored andcommitted
tests: use "$TEST_DIRECTORY" instead of ".."
The $TEST_DIRECTORY variable allows tests to find the top-level test directory regardless of the current working directory. In the past, this has been used to accomodate tests which change directories, but it is also the first step to being able to move trash directories outside of the $TEST_DIRECTORY hierarchy. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d82e75e commit eaf0551

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

t/t3404-rebase-interactive.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ that the result still makes sense.
1010
'
1111
. ./test-lib.sh
1212

13-
. ../lib-rebase.sh
13+
. "$TEST_DIRECTORY"/lib-rebase.sh
1414

1515
set_fake_editor
1616

t/t3411-rebase-preserve-around-merges.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ a merge to before the merge.
1010
'
1111
. ./test-lib.sh
1212

13-
. ../lib-rebase.sh
13+
. "$TEST_DIRECTORY"/lib-rebase.sh
1414

1515
set_fake_editor
1616

t/t3414-rebase-preserve-onto.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ aren'"'"'t on top of $ONTO, even if they are on top of $UPSTREAM.
1010
'
1111
. ./test-lib.sh
1212

13-
. ../lib-rebase.sh
13+
. "$TEST_DIRECTORY"/lib-rebase.sh
1414

1515
# Set up branches like this:
1616
# A1---B1---E1---F1---G1

t/t4020-diff-external.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ test_expect_success 'diff --cached' '
166166
git update-index --assume-unchanged file &&
167167
echo second >file &&
168168
git diff --cached >actual &&
169-
test_cmp ../t4020/diff.NUL actual
169+
test_cmp "$TEST_DIRECTORY"/t4020/diff.NUL actual
170170
'
171171

172172
test_done

0 commit comments

Comments
 (0)