[PATCH/RFC v2 2/4] rev-parse: Don't recognise --flags as an option if --no-flags has been specified.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Previously:
   $ git rev-parse --no-flags --flags -X
   -X

now:
   $ git rev-parse --no-flags --flags -X


Signed-off-by: Jon Seymour <jon.seymour@xxxxxxxxx>
---
 builtin/rev-parse.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index 9e340c7..d403d29 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -520,6 +520,10 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
 				continue;
 			}
 			if (!strcmp(arg, "--flags")) {
+				if (!(filter & DO_FLAGS)) {
+					// --preceding --no-flags means --flags is ignored
+					continue;
+				}
 				filter &= ~DO_NONFLAGS;
 				continue;
 			}
-- 
1.7.3.1.gc81ce.dirty

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]