git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-am: implement --reject option passed to git-apply

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 24, 2009, 00:59 UTC
Message-ID
<7v7i4lr01m.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1232670681-25781-1-git-send-email-madduck@madduck.net>
"martin f. krafft" <madduck@madduck.net> writes:
> The patch does not touch t/t4252-am-options.sh (yet) because I do not really
> understand how the testing system works.
I'll squash this in, then.
Thanks.
 t/t4252-am-options.sh |   11 ++++++++++-
 t/t4252/am-test-6-1   |   21 +++++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletions(-)
diff --git c/t/t4252-am-options.sh i/t/t4252-am-options.sh
index 5fdd188..f603c1b 100755
--- c/t/t4252-am-options.sh
+++ i/t/t4252-am-options.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-test_description='git am not losing options'
+test_description='git am with options and not losing them'
 . ./test-lib.sh
 
 tm="$TEST_DIRECTORY/t4252"
@@ -66,4 +66,13 @@ test_expect_success 'apply to a funny path' '
 	test -f "$with_sq/file-5"
 '
 
+test_expect_success 'am --reject' '
+	rm -rf .git/rebase-apply &&
+	git reset --hard initial &&
+	test_must_fail git am --reject "$tm"/am-test-6-1 &&
+	grep "@@ -1,3 +1,3 @@" file-2.rej &&
+	test_must_fail git diff-files --exit-code --quiet file-2 &&
+	grep "[-]-reject" .git/rebase-apply/apply-opt
+'
+
 test_done
diff --git c/t/t4252/am-test-6-1 i/t/t4252/am-test-6-1
new file mode 100644
index 0000000..a8859e9
--- /dev/null
+++ i/t/t4252/am-test-6-1
@@ -0,0 +1,21 @@
+From: A U Thor <au.thor@example.com>
+Date: Thu Dec 4 16:00:00 2008 -0800
+Subject: Huh
+
+Should fail and leave rejects
+
+diff --git i/file-2 w/file-2
+index 06e567b..b6f3a16 100644
+--- i/file-2
++++ w/file-2
+@@ -1,3 +1,3 @@
+-0
++One
+ 2
+ 3
+@@ -4,4 +4,4 @@
+ 4
+ 5
+-6
++Six
+ 7
Previous: martin f. krafft
Message 2 of 2 in “git-am: implement --reject option passed to git-apply”
  1. git-am: implement --reject option passed to git-applymartin f. krafft, Jan 23, 2009
  2. Junio C HamanoJan 24, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.