Skip to content

Commit 382da40

Browse files
felipecgitster
authored andcommitted
format-patch: fix parsing of "--" on the command line
When given a pathspec that does not match any path in the current work tree with an explicit "--": git format-patch <commit> -- <path> the command still complains that <path> does not exist in the current work tree and the user needs to explicitly specify "--" and errors out. This is because it incorrectly removes "--" from the command line arguments that is later passed to setup_revisions(). Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 78d553b commit 382da40

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

builtin-log.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
966966
*/
967967
argc = parse_options(argc, argv, prefix, builtin_format_patch_options,
968968
builtin_format_patch_usage,
969-
PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN);
969+
PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN |
970+
PARSE_OPT_KEEP_DASHDASH);
970971

971972
if (do_signoff) {
972973
const char *committer;

0 commit comments

Comments
 (0)