Thread (2 messages) flat view 2 messages, 1 author, 2016-06-15

git-rev-parse: pass on "--" flag when required

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:09
Subsystem: the rest · Maintainer: Linus Torvalds

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 '-'.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
---
diff --git a/rev-parse.c b/rev-parse.c
index 85230df..9ae2512 100644
--- a/rev-parse.c
+++ b/rev-parse.c
@@ -174,6 +174,9 @@ int main(int argc, char **argv)
 		if (*arg == '-') {
 			if (!strcmp(arg, "--")) {
 				as_is = 1;
+				/* Pass on the "--" if we show anything but files.. */
+				if (filter & (DO_FLAGS | DO_REVS))
+					show_file(arg);
 				continue;
 			}
 			if (!strcmp(arg, "--default")) {
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help