mirror of
https://github.com/git/git
synced 2024-10-30 04:01:21 +00:00
26e28fe7bb
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>
22 lines
468 B
C
22 lines
468 B
C
#include "test-tool.h"
|
|
#include "cache.h"
|
|
#include "advice.h"
|
|
#include "config.h"
|
|
|
|
int cmd__advise_if_enabled(int argc, const char **argv)
|
|
{
|
|
if (argc != 2)
|
|
die("usage: %s <advice>", argv[0]);
|
|
|
|
setup_git_directory();
|
|
git_config(git_default_config, NULL);
|
|
|
|
/*
|
|
* Any advice type can be used for testing, but NESTED_TAG was
|
|
* selected here and in t0018 where this command is being
|
|
* executed.
|
|
*/
|
|
advise_if_enabled(ADVICE_NESTED_TAG, argv[1]);
|
|
|
|
return 0;
|
|
}
|