[PATCH 4/4] name-rev: ease up condition
- From
Stefan Beller <stefanbeller@googlemail.com>
- Date
- Jul 29, 2013, 19:49 UTC
- Message-ID
- <1375127398-31904-5-git-send-email-stefanbeller@googlemail.com>
- In-Reply-To
- <1375127398-31904-1-git-send-email-stefanbeller@googlemail.com>
Now that the internal variables 'all' and 'transform_stdin' are read in by OPT_BOOL, which makes sure to have the variable being 0 or 1 after reading, we do not need the double negation to map any other value to 1.
Signed-off-by: Stefan Beller <stefanbeller@googlemail.com> --- builtin/name-rev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/name-rev.c b/builtin/name-rev.c index a908a34..20fcf8c 100644 --- a/builtin/name-rev.c +++ b/builtin/name-rev.c @@ -331,7 +331,7 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix) git_config(git_default_config, NULL); argc = parse_options(argc, argv, prefix, opts, name_rev_usage, 0); - if (!!all + !!transform_stdin + !!argc > 1) { + if (all + transform_stdin + !!argc > 1) { error("Specify either a list, or --all, not both!"); usage_with_options(name_rev_usage, opts); }
-- 1.8.4.rc0.1.g8f6a3e5