summaryrefslogtreecommitdiff
path: root/t/helper/test-advise.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2020-09-30 12:30:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-09-30 19:53:48 (GMT)
commit26e28fe7bbdf8b22ed096dfd76a9311e86ffb200 (patch)
tree614b034dd10586c1d6ddb60614dd03067723396f /t/helper/test-advise.c
parent75d3bee15778a3aaeb8234023fc224838ac53181 (diff)
downloadgit-26e28fe7bbdf8b22ed096dfd76a9311e86ffb200.zip
git-26e28fe7bbdf8b22ed096dfd76a9311e86ffb200.tar.gz
git-26e28fe7bbdf8b22ed096dfd76a9311e86ffb200.tar.bz2
test-advise: check argument count with argc instead of argv
We complain if "test-tool advise" is not given an argument, but we quietly ignore any additional arguments it receives. Let's instead check that we got the expected number. As a bonus, this silences -Wunused-parameter, which notes that we don't ever look at argc. While we're here, we can also fix the indentation in the conditional. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper/test-advise.c')
-rw-r--r--t/helper/test-advise.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/helper/test-advise.c b/t/helper/test-advise.c
index 38cdc28..a7043df 100644
--- a/t/helper/test-advise.c
+++ b/t/helper/test-advise.c
@@ -5,8 +5,8 @@
int cmd__advise_if_enabled(int argc, const char **argv)
{
- if (!argv[1])
- die("usage: %s <advice>", argv[0]);
+ if (argc != 2)
+ die("usage: %s <advice>", argv[0]);
setup_git_directory();
git_config(git_default_config, NULL);