Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-02-20 17:15:19 +0300
committerJunio C Hamano <gitster@pobox.com>2020-02-21 00:20:41 +0300
commitaa416b22ea73321aba94c3c96db0491fb25ea7ea (patch)
treea0e3e1c9f67208bfbdf6666da0221a1574c9d52a /t/t4150-am.sh
parentf3b4822899dc4ddca688de285f01e1d12aeb33b6 (diff)
am: support --show-current-patch=diff to retrieve .git/rebase-apply/patch
When "git am --show-current-patch" was added in commit 984913a210 ("am: add --show-current-patch", 2018-02-12), "git am" started recommending it as a replacement for .git/rebase-merge/patch. Unfortunately the suggestion is somewhat misguided; for example, the output of "git am --show-current-patch" cannot be passed to "git apply" if it is encoded as quoted-printable or base64. Add a new mode to "git am --show-current-patch" in order to straighten the suggestion. Reported-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4150-am.sh')
-rwxr-xr-xt/t4150-am.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index afe456e75e..cb45271457 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -671,11 +671,21 @@ test_expect_success 'am --show-current-patch=raw' '
test_cmp .git/rebase-apply/0001 actual.patch
'
+test_expect_success 'am --show-current-patch=diff' '
+ git am --show-current-patch=diff >actual.patch &&
+ test_cmp .git/rebase-apply/patch actual.patch
+'
+
test_expect_success 'am accepts repeated --show-current-patch' '
git am --show-current-patch --show-current-patch=raw >actual.patch &&
test_cmp .git/rebase-apply/0001 actual.patch
'
+test_expect_success 'am detects incompatible --show-current-patch' '
+ test_must_fail git am --show-current-patch=raw --show-current-patch=diff &&
+ test_must_fail git am --show-current-patch --show-current-patch=diff
+'
+
test_expect_success 'am --skip works' '
echo goodbye >expected &&
git am --skip &&