@matheusbsbs / matheus-bagliano / commits / a08b650594
Fork 0

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>

Linus Torvalds committed Oct 20, 2005 at 17:16 UTC a08b6505942c3c7137f8fb7516a2d5bc54153997
1 file changed +4
rev-parse.c
+4
@@ -174,6 +174,10 @@ int main(int argc, char **argv)
174 if (*arg == '-') {
175 if (!strcmp(arg, "--")) {
176 as_is = 1;
177 + show_default();
178 + /* Pass on the "--" if we show anything but files.. */
179 + if (filter & (DO_FLAGS | DO_REVS))
180 + show_file(arg);
181 continue;
182 }
183 if (!strcmp(arg, "--default")) {