t4150: am refuses patches when paused
Since c95b138 (Fix git-am safety checks, 2006-09-15), when there is a session in progress, git-am will check the command-line arguments and standard input to ensure that the user does not pass it any patches. Add a test for this. Reviewed-by: Stefan Beller <sbeller@google.com> Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Paul Tan <pyokagan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Paul Tan committed
Jul 19, 2015 at 23:49 UTC
b4967ab49003e78bc4555de686a20bc82d56614f
1 file changed
+14
t/t4150-am.sh
+14
@@ -397,6 +397,20 @@ test_expect_success 'am --abort removes a stray directory' '
397
test_path_is_missing .git/rebase-apply
398
'
399
400
+test_expect_success 'am refuses patches when paused' '
401
+ rm -fr .git/rebase-apply &&
402
+ git reset --hard &&
403
+ git checkout lorem2^^ &&
404
+
405
+ test_must_fail git am lorem-move.patch &&
406
+ test_path_is_dir .git/rebase-apply &&
407
+ test_cmp_rev lorem2^^ HEAD &&
408
+
409
+ test_must_fail git am <lorem-move.patch &&
410
+ test_path_is_dir .git/rebase-apply &&
411
+ test_cmp_rev lorem2^^ HEAD
412
+'
413
+
414
test_expect_success 'am --resolved works' '
415
echo goodbye >expected &&
416
rm -fr .git/rebase-apply &&