Skip to content

Commit

Permalink
format-patch: fix parsing of "--" on the command line
Browse files Browse the repository at this point in the history
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 <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Felipe Contreras authored and Junio C Hamano committed Nov 27, 2009
1 parent 78d553b commit 382da40
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion builtin-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
*/
argc = parse_options(argc, argv, prefix, builtin_format_patch_options,
builtin_format_patch_usage,
PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN);
PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN |
PARSE_OPT_KEEP_DASHDASH);

if (do_signoff) {
const char *committer;
Expand Down

0 comments on commit 382da40

Please sign in to comment.