summaryrefslogtreecommitdiff
path: root/t/helper
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-03-25 13:57:41 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-03-25 13:57:41 -0700
commitc4a09cc9ccb63090b78a4d9529462151df62d73d (patch)
tree1ffed9c273282fbc4c977dabc1a1692b03d67329 /t/helper
parentGit 2.26 (diff)
parenttag: use new advice API to check visibility (diff)
downloadtgif-c4a09cc9ccb63090b78a4d9529462151df62d73d.tar.xz
Merge branch 'hw/advise-ng'
Revamping of the advise API to allow more systematic enumeration of advice knobs in the future. * hw/advise-ng: tag: use new advice API to check visibility advice: revamp advise API advice: change "setupStreamFailure" to "setUpstreamFailure" advice: extract vadvise() from advise()
Diffstat (limited to 't/helper')
-rw-r--r--t/helper/test-advise.c22
-rw-r--r--t/helper/test-tool.c1
-rw-r--r--t/helper/test-tool.h1
3 files changed, 24 insertions, 0 deletions
diff --git a/t/helper/test-advise.c b/t/helper/test-advise.c
new file mode 100644
index 0000000000..38cdc2884e
--- /dev/null
+++ b/t/helper/test-advise.c
@@ -0,0 +1,22 @@
+#include "test-tool.h"
+#include "cache.h"
+#include "advice.h"
+#include "config.h"
+
+int cmd__advise_if_enabled(int argc, const char **argv)
+{
+ if (!argv[1])
+ 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;
+}
diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c
index c9a232d238..31eedcd241 100644
--- a/t/helper/test-tool.c
+++ b/t/helper/test-tool.c
@@ -14,6 +14,7 @@ struct test_cmd {
};
static struct test_cmd cmds[] = {
+ { "advise", cmd__advise_if_enabled },
{ "chmtime", cmd__chmtime },
{ "config", cmd__config },
{ "ctype", cmd__ctype },
diff --git a/t/helper/test-tool.h b/t/helper/test-tool.h
index c8549fd87f..4eb5e6609e 100644
--- a/t/helper/test-tool.h
+++ b/t/helper/test-tool.h
@@ -4,6 +4,7 @@
#define USE_THE_INDEX_COMPATIBILITY_MACROS
#include "git-compat-util.h"
+int cmd__advise_if_enabled(int argc, const char **argv);
int cmd__chmtime(int argc, const char **argv);
int cmd__config(int argc, const char **argv);
int cmd__ctype(int argc, const char **argv);