summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7334f06)
raw | patch | inline | side by side (parent: 7334f06)
author | Linus Torvalds <torvalds@osdl.org> | |
Sun, 5 Feb 2006 19:58:34 +0000 (11:58 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 5 Feb 2006 21:44:59 +0000 (13:44 -0800) |
Using "--verify" together with "--no-flags" makes perfect sense, but
git-rev-parse would complain about it when it saw a flag, even though it
would never actually use/output that flag.
This fixes it.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-rev-parse would complain about it when it saw a flag, even though it
would never actually use/output that flag.
This fixes it.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
rev-parse.c | patch | blob | history |
diff --git a/rev-parse.c b/rev-parse.c
index 6bf205a8f53c6af76bb1cc4df7bf37e46d378890..9cec33b8c00c322d6acde3e588a5c1dfe53f948d 100644 (file)
--- a/rev-parse.c
+++ b/rev-parse.c
}
/* Output a flag, only if filter allows it. */
-static void show_flag(char *arg)
+static int show_flag(char *arg)
{
if (!(filter & DO_FLAGS))
- return;
- if (filter & (is_rev_argument(arg) ? DO_REVS : DO_NOREV))
+ return 0;
+ if (filter & (is_rev_argument(arg) ? DO_REVS : DO_NOREV)) {
show(arg);
+ return 1;
+ }
+ return 0;
}
static void show_default(void)
show_datestring("--min-age=", arg+8);
continue;
}
- if (verify)
+ if (show_flag(arg) && verify)
die("Needed a single revision");
- show_flag(arg);
continue;
}