@@ -54,21 +54,21 @@ test_expect_success 'fails without MERGE_HEAD (unstarted merge)' '
5454'
5555
5656test_expect_success ' fails without MERGE_HEAD (unstarted merge): .git/MERGE_HEAD sanity' '
57- test ! -f .git/MERGE_HEAD &&
57+ test_path_is_missing .git/MERGE_HEAD &&
5858 test "$pre_merge_head" = "$(git rev-parse HEAD)"
5959'
6060
6161test_expect_success ' fails without MERGE_HEAD (completed merge)' '
6262 git merge clean_branch &&
63- test ! -f .git/MERGE_HEAD &&
63+ test_path_is_missing .git/MERGE_HEAD &&
6464 # Merge successfully completed
6565 post_merge_head="$(git rev-parse HEAD)" &&
6666 test_must_fail git merge --abort 2>output &&
6767 test_grep MERGE_HEAD output
6868'
6969
7070test_expect_success ' fails without MERGE_HEAD (completed merge): .git/MERGE_HEAD sanity' '
71- test ! -f .git/MERGE_HEAD &&
71+ test_path_is_missing .git/MERGE_HEAD &&
7272 test "$post_merge_head" = "$(git rev-parse HEAD)"
7373'
7474
@@ -79,10 +79,10 @@ test_expect_success 'Forget previous merge' '
7979test_expect_success ' Abort after --no-commit' '
8080 # Redo merge, but stop before creating merge commit
8181 git merge --no-commit clean_branch &&
82- test -f .git/MERGE_HEAD &&
82+ test_path_is_file .git/MERGE_HEAD &&
8383 # Abort non-conflicting merge
8484 git merge --abort &&
85- test ! -f .git/MERGE_HEAD &&
85+ test_path_is_missing .git/MERGE_HEAD &&
8686 test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
8787 test -z "$(git diff)" &&
8888 test -z "$(git diff --staged)"
@@ -91,10 +91,10 @@ test_expect_success 'Abort after --no-commit' '
9191test_expect_success ' Abort after conflicts' '
9292 # Create conflicting merge
9393 test_must_fail git merge conflict_branch &&
94- test -f .git/MERGE_HEAD &&
94+ test_path_is_file .git/MERGE_HEAD &&
9595 # Abort conflicting merge
9696 git merge --abort &&
97- test ! -f .git/MERGE_HEAD &&
97+ test_path_is_missing .git/MERGE_HEAD &&
9898 test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
9999 test -z "$(git diff)" &&
100100 test -z "$(git diff --staged)"
@@ -105,7 +105,7 @@ test_expect_success 'Clean merge with dirty index fails' '
105105 git add foo &&
106106 git diff --staged > expect &&
107107 test_must_fail git merge clean_branch &&
108- test ! -f .git/MERGE_HEAD &&
108+ test_path_is_missing .git/MERGE_HEAD &&
109109 test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
110110 test -z "$(git diff)" &&
111111 git diff --staged > actual &&
@@ -114,7 +114,7 @@ test_expect_success 'Clean merge with dirty index fails' '
114114
115115test_expect_success ' Conflicting merge with dirty index fails' '
116116 test_must_fail git merge conflict_branch &&
117- test ! -f .git/MERGE_HEAD &&
117+ test_path_is_missing .git/MERGE_HEAD &&
118118 test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
119119 test -z "$(git diff)" &&
120120 git diff --staged > actual &&
@@ -129,10 +129,10 @@ test_expect_success 'Reset index (but preserve worktree changes)' '
129129
130130test_expect_success ' Abort clean merge with non-conflicting dirty worktree' '
131131 git merge --no-commit clean_branch &&
132- test -f .git/MERGE_HEAD &&
132+ test_path_is_file .git/MERGE_HEAD &&
133133 # Abort merge
134134 git merge --abort &&
135- test ! -f .git/MERGE_HEAD &&
135+ test_path_is_missing .git/MERGE_HEAD &&
136136 test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
137137 test -z "$(git diff --staged)" &&
138138 git diff > actual &&
@@ -141,10 +141,10 @@ test_expect_success 'Abort clean merge with non-conflicting dirty worktree' '
141141
142142test_expect_success ' Abort conflicting merge with non-conflicting dirty worktree' '
143143 test_must_fail git merge conflict_branch &&
144- test -f .git/MERGE_HEAD &&
144+ test_path_is_file .git/MERGE_HEAD &&
145145 # Abort merge
146146 git merge --abort &&
147- test ! -f .git/MERGE_HEAD &&
147+ test_path_is_missing .git/MERGE_HEAD &&
148148 test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
149149 test -z "$(git diff --staged)" &&
150150 git diff > actual &&
@@ -159,7 +159,7 @@ test_expect_success 'Fail clean merge with conflicting dirty worktree' '
159159 echo xyzzy >> bar &&
160160 git diff > expect &&
161161 test_must_fail git merge --no-commit clean_branch &&
162- test ! -f .git/MERGE_HEAD &&
162+ test_path_is_missing .git/MERGE_HEAD &&
163163 test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
164164 test -z "$(git diff --staged)" &&
165165 git diff > actual &&
@@ -168,7 +168,7 @@ test_expect_success 'Fail clean merge with conflicting dirty worktree' '
168168
169169test_expect_success ' Fail conflicting merge with conflicting dirty worktree' '
170170 test_must_fail git merge conflict_branch &&
171- test ! -f .git/MERGE_HEAD &&
171+ test_path_is_missing .git/MERGE_HEAD &&
172172 test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
173173 test -z "$(git diff --staged)" &&
174174 git diff > actual &&
@@ -183,7 +183,7 @@ test_expect_success 'Fail clean merge with matching dirty worktree' '
183183 echo bart > bar &&
184184 git diff > expect &&
185185 test_must_fail git merge --no-commit clean_branch &&
186- test ! -f .git/MERGE_HEAD &&
186+ test_path_is_missing .git/MERGE_HEAD &&
187187 test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
188188 test -z "$(git diff --staged)" &&
189189 git diff > actual &&
@@ -194,7 +194,7 @@ test_expect_success 'Fail conflicting merge with matching dirty worktree' '
194194 echo barf > bar &&
195195 git diff > expect &&
196196 test_must_fail git merge conflict_branch &&
197- test ! -f .git/MERGE_HEAD &&
197+ test_path_is_missing .git/MERGE_HEAD &&
198198 test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
199199 test -z "$(git diff --staged)" &&
200200 git diff > actual &&
0 commit comments