Skip to content

Commit b4967ab

Browse files
pyokagangitster
authored andcommitted
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>
1 parent 528484c commit b4967ab

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

t/t4150-am.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,20 @@ test_expect_success 'am --abort removes a stray directory' '
397397
test_path_is_missing .git/rebase-apply
398398
'
399399

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+
400414
test_expect_success 'am --resolved works' '
401415
echo goodbye >expected &&
402416
rm -fr .git/rebase-apply &&

0 commit comments

Comments
 (0)