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 <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Linus Torvalds 2005-10-20 17:16:30 -07:00 committed by Junio C Hamano
parent adc3dbca1a
commit a08b650594

View File

@ -174,6 +174,10 @@ int main(int argc, char **argv)
if (*arg == '-') { if (*arg == '-') {
if (!strcmp(arg, "--")) { if (!strcmp(arg, "--")) {
as_is = 1; as_is = 1;
show_default();
/* Pass on the "--" if we show anything but files.. */
if (filter & (DO_FLAGS | DO_REVS))
show_file(arg);
continue; continue;
} }
if (!strcmp(arg, "--default")) { if (!strcmp(arg, "--default")) {