84
test_path_is_missing actual_hooks
85
'
86
87
+test_expect_success '--no-verify with no hook (merge)' '
88
+ test_when_finished "rm -f actual_hooks" &&
89
+ git branch -f side side-orig &&
90
+ git checkout side &&
91
+ git merge --no-verify -m "merge master" master &&
92
+ git checkout master &&
93
+ test_path_is_missing actual_hooks
94
+'
95
+
96
test_expect_success 'with succeeding hook' '
97
test_when_finished "rm -f \"$PRECOMMIT\" expected_hooks actual_hooks" &&
98
cp "$HOOKDIR/success.sample" "$PRECOMMIT" &&
140
test_path_is_missing actual_hooks
141
'
142
143
+test_expect_success '--no-verify with succeeding hook (merge)' '
144
+ test_when_finished "rm -f \"$PREMERGE\" actual_hooks" &&
145
+ cp "$HOOKDIR/success.sample" "$PREMERGE" &&
146
+ git branch -f side side-orig &&
147
+ git checkout side &&
148
+ git merge --no-verify -m "merge master" master &&
149
+ git checkout master &&
150
+ test_path_is_missing actual_hooks
151
+'
152
+
153
test_expect_success 'with failing hook' '
154
test_when_finished "rm -f \"$PRECOMMIT\" expected_hooks actual_hooks" &&
155
cp "$HOOKDIR/fail.sample" "$PRECOMMIT" &&
179
test_cmp expected_hooks actual_hooks
180
'
181
182
+test_expect_success '--no-verify with failing hook (merge)' '
183
+ test_when_finished "rm -f \"$PREMERGE\" actual_hooks" &&
184
+ cp "$HOOKDIR/fail.sample" "$PREMERGE" &&
185
+ git branch -f side side-orig &&
186
+ git checkout side &&
187
+ git merge --no-verify -m "merge master" master &&
188
+ git checkout master &&
189
+ test_path_is_missing actual_hooks
190
+'
191
+
192
test_expect_success POSIXPERM 'with non-executable hook' '
193
test_when_finished "rm -f \"$PRECOMMIT\" actual_hooks" &&
194
cp "$HOOKDIR/non-exec.sample" "$PRECOMMIT" &&
217
test_path_is_missing actual_hooks
218
'
219
220
+test_expect_success POSIXPERM '--no-verify with non-executable hook (merge)' '
221
+ test_when_finished "rm -f \"$PREMERGE\" actual_hooks" &&
222
+ cp "$HOOKDIR/non-exec.sample" "$PREMERGE" &&
223
+ git branch -f side side-orig &&
224
+ git checkout side &&
225
+ git merge --no-verify -m "merge master" master &&
226
+ git checkout master &&
227
+ test_path_is_missing actual_hooks
228
+'
229
+
230
test_expect_success 'with hook requiring GIT_PREFIX' '
231
test_when_finished "rm -rf \"$PRECOMMIT\" expected_hooks actual_hooks success" &&
232
cp "$HOOKDIR/require-prefix.sample" "$PRECOMMIT" &&