summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorHeba Waly <heba.waly@gmail.com>2020-03-02 20:02:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-03-05 14:15:04 (GMT)
commitf665d63a912748bc1397940a0dc1de80c6f693e3 (patch)
tree0c5c33a8281d32eb41e74585650a0da71e737b83 /builtin
parentb3b18d1621315fb187689ee6c759bdbbea214eb8 (diff)
downloadgit-f665d63a912748bc1397940a0dc1de80c6f693e3.zip
git-f665d63a912748bc1397940a0dc1de80c6f693e3.tar.gz
git-f665d63a912748bc1397940a0dc1de80c6f693e3.tar.bz2
tag: use new advice API to check visibility
change the advise call in tag library from advise() to advise_if_enabled() to construct an example of the usage of the new API. Signed-off-by: Heba Waly <heba.waly@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/tag.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/tag.c b/builtin/tag.c
index e0a4c25..cc30d34 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -231,8 +231,9 @@ static void create_tag(const struct object_id *object, const char *object_ref,
if (type <= OBJ_NONE)
die(_("bad object type."));
- if (type == OBJ_TAG && advice_nested_tag)
- advise(_(message_advice_nested_tag), tag, object_ref);
+ if (type == OBJ_TAG)
+ advise_if_enabled(ADVICE_NESTED_TAG, _(message_advice_nested_tag),
+ tag, object_ref);
strbuf_addf(&header,
"object %s\n"