Skip to content

Commit c8b1d76

Browse files
committed
Merge branch 'fc/maint-format-patch-pathspec-dashes' into maint
* fc/maint-format-patch-pathspec-dashes: format-patch: add test for parsing of "--" format-patch: fix parsing of "--" on the command line
2 parents 99292c6 + 7e93d3b commit c8b1d76

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

builtin-log.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
969969
*/
970970
argc = parse_options(argc, argv, prefix, builtin_format_patch_options,
971971
builtin_format_patch_usage,
972-
PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN);
972+
PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN |
973+
PARSE_OPT_KEEP_DASHDASH);
973974

974975
if (do_signoff) {
975976
const char *committer;

t/t4014-format-patch.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,4 +536,9 @@ test_expect_success 'format-patch --signoff' '
536536
grep "^Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"
537537
'
538538

539+
test_expect_success 'format-patch -- <path>' '
540+
git format-patch master..side -- file 2>error &&
541+
! grep "Use .--" error
542+
'
543+
539544
test_done

0 commit comments

Comments
 (0)