File tree Expand file tree Collapse file tree 4 files changed +36
-1
lines changed
Expand file tree Collapse file tree 4 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ SYNOPSIS
1212'git am' [--signoff] [--keep] [--utf8 | --no-utf8]
1313 [--3way] [--interactive]
1414 [--whitespace=<option>] [-C<n>] [-p<n>] [--directory=<dir>]
15+ [--reject]
1516 [<mbox> | <Maildir>...]
1617'git am' (--skip | --resolved | --abort)
1718
@@ -63,6 +64,7 @@ default. You could use `--no-utf8` to override this.
6364-C<n>::
6465-p<n>::
6566--directory=<dir>::
67+ --reject::
6668 These flags are passed to the 'git-apply' (see linkgit:git-apply[1])
6769 program that applies
6870 the patch.
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ whitespace= pass it through git-apply
1919directory= pass it through git-apply
2020C= pass it through git-apply
2121p= pass it through git-apply
22+ reject pass it through git-apply
2223resolvemsg= override error message when patch failure occurs
2324r,resolved to be used after a patch failure
2425skip skip the current patch
168169 git_apply_opt=" $git_apply_opt $( sq " $1 =$2 " ) " ; shift ;;
169170 -C|-p)
170171 git_apply_opt=" $git_apply_opt $( sq " $1$2 " ) " ; shift ;;
172+ --reject)
173+ git_apply_opt=" $git_apply_opt $1 " ;;
171174 --)
172175 shift ; break ;;
173176 * )
Original file line number Diff line number Diff line change 11#! /bin/sh
22
3- test_description=' git am not losing options '
3+ test_description=' git am with options and not losing them '
44. ./test-lib.sh
55
66tm=" $TEST_DIRECTORY /t4252"
@@ -66,4 +66,13 @@ test_expect_success 'apply to a funny path' '
6666 test -f "$with_sq/file-5"
6767'
6868
69+ test_expect_success ' am --reject' '
70+ rm -rf .git/rebase-apply &&
71+ git reset --hard initial &&
72+ test_must_fail git am --reject "$tm"/am-test-6-1 &&
73+ grep "@@ -1,3 +1,3 @@" file-2.rej &&
74+ test_must_fail git diff-files --exit-code --quiet file-2 &&
75+ grep "[-]-reject" .git/rebase-apply/apply-opt
76+ '
77+
6978test_done
Original file line number Diff line number Diff line change 1+ From: A U Thor <au.thor@example.com>
2+ Date: Thu Dec 4 16:00:00 2008 -0800
3+ Subject: Huh
4+
5+ Should fail and leave rejects
6+
7+ diff --git i/file-2 w/file-2
8+ index 06e567b..b6f3a16 100644
9+ --- i/file-2
10+ +++ w/file-2
11+ @@ -1,3 +1,3 @@
12+ -0
13+ +One
14+ 2
15+ 3
16+ @@ -4,4 +4,4 @@
17+ 4
18+ 5
19+ -6
20+ +Six
21+ 7
You can’t perform that action at this time.
0 commit comments