diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-05-06 00:36:25 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-05-06 00:36:25 +0300 |
commit | 676cead4550f4d85f0a841493b74e73b54fd19c0 (patch) | |
tree | 17c925d8a4528478cbb0979be3a01a36fb9dd0f1 /t | |
parent | 09a2302c70a2e1023a16980afa920f36e6aa63ac (diff) | |
parent | 91f8f7e46fd86f2d20e93e00af451bf75febfe18 (diff) |
Merge branch 'rs/format-patch-pathspec-fix' into maint
"git format-patch <args> -- <pathspec>" lost the pathspec when
showing the second and subsequent commits, which has been
corrected.
source: <c36896a1-6247-123b-4fa3-b7eb24af1897@web.de>
* rs/format-patch-pathspec-fix:
2.36 format-patch regression fix
Diffstat (limited to 't')
-rwxr-xr-x | t/t4014-format-patch.sh | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 7dc5a5c736..fbec8ad2ef 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -926,11 +926,40 @@ test_expect_success 'format-patch --numstat should produce a patch' ' ' test_expect_success 'format-patch -- <path>' ' - git format-patch main..side -- file 2>error && - ! grep "Use .--" error + rm -f *.patch && + git checkout -b pathspec main && + + echo file_a 1 >file_a && + echo file_b 1 >file_b && + git add file_a file_b && + git commit -m pathspec_initial && + + echo file_a 2 >>file_a && + git add file_a && + git commit -m pathspec_a && + + echo file_b 2 >>file_b && + git add file_b && + git commit -m pathspec_b && + + echo file_a 3 >>file_a && + echo file_b 3 >>file_b && + git add file_a file_b && + git commit -m pathspec_ab && + + cat >expect <<-\EOF && + 0001-pathspec_initial.patch + 0002-pathspec_a.patch + 0003-pathspec_ab.patch + EOF + + git format-patch main..pathspec -- file_a >output && + test_cmp expect output && + ! grep file_b *.patch ' test_expect_success 'format-patch --ignore-if-in-upstream HEAD' ' + git checkout side && git format-patch --ignore-if-in-upstream HEAD ' |