From: Linus Torvalds Date: Fri, 21 Oct 2005 00:16:30 +0000 (-0700) Subject: git-rev-parse: pass on "--" flag when required X-Git-Tag: v0.99.9~74 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=a08b6505942c3c7137f8fb7516a2d5bc54153997;p=git.git git-rev-parse: pass on "--" flag when required If rev-parse output includes both flags and files, we should pass on any "--" marker we see, so that the end result can also tell the difference between a flag and a filename that begins with '-'. [jc: merged a later one liner updates from Linus] Signed-off-by: Linus Torvalds Signed-off-by: Junio C Hamano --- diff --git a/rev-parse.c b/rev-parse.c index 85230dfa..243f89f3 100644 --- a/rev-parse.c +++ b/rev-parse.c @@ -174,6 +174,10 @@ int main(int argc, char **argv) if (*arg == '-') { if (!strcmp(arg, "--")) { as_is = 1; + show_default(); + /* Pass on the "--" if we show anything but files.. */ + if (filter & (DO_FLAGS | DO_REVS)) + show_file(arg); continue; } if (!strcmp(arg, "--default")) {