Skip to content

Commit 2745817

Browse files
szedergitster
authored andcommitted
t3420-rebase-autostash: don't try to grep non-existing files
Several tests in 't3420-rebase-autostash.sh' start various rebase processes that are expected to fail because of merge conflicts. These tests then run '! grep' to ensure that the autostash feature did its job, and the dirty contents of a file is gone. However, due to the test repo's history and the choice of upstream branch that file shouldn't exist in the conflicted state at all. Consequently, this 'grep' doesn't fail as expected, because it can't find the dirty content, but it fails because it can't open the file. Tighten this check by using 'test_path_is_missing' instead, thereby avoiding unexpected errors from 'grep' as well. Signed-off-by: SZEDER Gábor <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 53f9a3e commit 2745817

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

t/t3420-rebase-autostash.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ testrebase () {
202202
echo dirty >>file3 &&
203203
test_must_fail git rebase$type related-onto-branch &&
204204
test_path_is_file $dotest/autostash &&
205-
! grep dirty file3 &&
205+
test_path_is_missing file3 &&
206206
rm -rf $dotest &&
207207
git reset --hard &&
208208
git checkout feature-branch
@@ -216,7 +216,7 @@ testrebase () {
216216
echo dirty >>file3 &&
217217
test_must_fail git rebase$type related-onto-branch &&
218218
test_path_is_file $dotest/autostash &&
219-
! grep dirty file3 &&
219+
test_path_is_missing file3 &&
220220
echo "conflicting-plus-goodbye" >file2 &&
221221
git add file2 &&
222222
git rebase --continue &&
@@ -233,7 +233,7 @@ testrebase () {
233233
echo dirty >>file3 &&
234234
test_must_fail git rebase$type related-onto-branch &&
235235
test_path_is_file $dotest/autostash &&
236-
! grep dirty file3 &&
236+
test_path_is_missing file3 &&
237237
git rebase --skip &&
238238
test_path_is_missing $dotest/autostash &&
239239
grep dirty file3 &&
@@ -248,7 +248,7 @@ testrebase () {
248248
echo dirty >>file3 &&
249249
test_must_fail git rebase$type related-onto-branch &&
250250
test_path_is_file $dotest/autostash &&
251-
! grep dirty file3 &&
251+
test_path_is_missing file3 &&
252252
git rebase --abort &&
253253
test_path_is_missing $dotest/autostash &&
254254
grep dirty file3 &&

0 commit comments

Comments
 (0)