[PATCH v2 1/3] format-patch: fix dashdash usage
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- Nov 28, 2009, 11:40 UTC
- Message-ID
- <1259408429-5685-2-git-send-email-felipe.contreras@gmail.com>
- In-Reply-To
- <1259408429-5685-1-git-send-email-felipe.contreras@gmail.com>
$ git format-patch <committish> -- <path-not-in-working-dir>
Doesn't work otherwise. The current code would complain that the path is not in the working tree and that "--" must be specified, even if the user _did_ specify it. This happens because "--" is removed from the arguments, so we need to pass PARSE_OPT_KEEP_DASHDASH to parse_options to avoid that.
Comments by Junio C Hamano.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> --- builtin-log.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/builtin-log.c b/builtin-log.c index 33fa6ea..1766349 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -976,7 +976,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;
-- 1.6.6.rc0.59.g5117f7.dirty