summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d930508)
raw | patch | inline | side by side (parent: d930508)
author | martin f. krafft <madduck@madduck.net> | |
Fri, 23 Jan 2009 00:31:21 +0000 (11:31 +1100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 24 Jan 2009 01:00:12 +0000 (17:00 -0800) |
With --reject, git-am simply passes the --reject option to git-apply and thus
allows people to work with reject files if they so prefer.
Signed-off-by: martin f. krafft <madduck@madduck.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
allows people to work with reject files if they so prefer.
Signed-off-by: martin f. krafft <madduck@madduck.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-am.txt | patch | blob | history | |
git-am.sh | patch | blob | history | |
t/t4252-am-options.sh | patch | blob | history | |
t/t4252/am-test-6-1 | [new file with mode: 0644] | patch | blob |
index 5cbbe7693708bcde50c2fa6717667785579d6722..efd311b1ceec1653281441b232da04decd122bc3 100644 (file)
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
'git am' [--signoff] [--keep] [--utf8 | --no-utf8]
[--3way] [--interactive]
[--whitespace=<option>] [-C<n>] [-p<n>] [--directory=<dir>]
+ [--reject]
[<mbox> | <Maildir>...]
'git am' (--skip | --resolved | --abort)
-C<n>::
-p<n>::
--directory=<dir>::
+--reject::
These flags are passed to the 'git-apply' (see linkgit:git-apply[1])
program that applies
the patch.
diff --git a/git-am.sh b/git-am.sh
index e20dd88392c892a6b88e29501e0b13be8a73aaf9..b1c05c9db3ba28220ec21ac8eddeb519a02df640 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
directory= pass it through git-apply
C= pass it through git-apply
p= pass it through git-apply
+reject pass it through git-apply
resolvemsg= override error message when patch failure occurs
r,resolved to be used after a patch failure
skip skip the current patch
git_apply_opt="$git_apply_opt $(sq "$1=$2")"; shift ;;
-C|-p)
git_apply_opt="$git_apply_opt $(sq "$1$2")"; shift ;;
+ --reject)
+ git_apply_opt="$git_apply_opt $1" ;;
--)
shift; break ;;
*)
diff --git a/t/t4252-am-options.sh b/t/t4252-am-options.sh
index 5fdd1885820927f32822019ccde52e6b783e31eb..f603c1b1336c4a00889177376d9b51077c9cc2ac 100755 (executable)
--- a/t/t4252-am-options.sh
+++ b/t/t4252-am-options.sh
#!/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"
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 a/t/t4252/am-test-6-1 b/t/t4252/am-test-6-1
--- /dev/null
+++ b/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