Skip to content

Commit e70f320

Browse files
dotdashgitster
authored andcommitted
t7005-editor.sh: Don't invoke real vi when it is in GIT_EXEC_PATH
The git wrapper executable always prepends the GIT_EXEC_PATH build variable to the current PATH, so prepending "." to the PATH is not enough to give precedence to the fake vi executable. The --exec-path option allows to prepend a directory to PATH even before GIT_EXEC_PATH (which is added anyway), so we can use that instead. Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent a91ef6e commit e70f320

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

t/t7005-editor.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ do
1313
done
1414
unset vi
1515
mv e-vi.sh vi
16-
PATH=".:$PATH"
1716
unset EDITOR VISUAL GIT_EDITOR
1817

1918
test_expect_success setup '
@@ -59,7 +58,7 @@ do
5958
;;
6059
esac
6160
test_expect_success "Using $i" '
62-
git commit --amend &&
61+
git --exec-path=. commit --amend &&
6362
git show -s --pretty=oneline |
6463
sed -e "s/^[0-9a-f]* //" >actual &&
6564
diff actual expect
@@ -81,7 +80,7 @@ do
8180
;;
8281
esac
8382
test_expect_success "Using $i (override)" '
84-
git commit --amend &&
83+
git --exec-path=. commit --amend &&
8584
git show -s --pretty=oneline |
8685
sed -e "s/^[0-9a-f]* //" >actual &&
8786
diff actual expect

0 commit comments

Comments
 (0)