aboutsummaryrefslogtreecommitdiff
path: root/builtin/tag.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-03-25 14:00:57 -0700
committerJunio C Hamano <gitster@pobox.com>2013-03-25 14:00:58 -0700
commit33c1506d6257897040eccc8167584a98fa8f88fe (patch)
tree1db2080386f66833d011ba7bd7fc321163b5573d /builtin/tag.c
parentf10a012088a7b6e418ec3f726142a8ddfa3d0264 (diff)
parent3ae851e6fbb4e99fa7281d18a5c6f95a3fb6d998 (diff)
downloadgit-33c1506d6257897040eccc8167584a98fa8f88fe.tar.gz
git-33c1506d6257897040eccc8167584a98fa8f88fe.tar.xz
Merge branch 'ph/tag-force-no-warn-on-creation'
"git tag -f <tag>" always said "Updated tag '<tag>'" even when creating a new tag (i.e. not overwriting nor updating). * ph/tag-force-no-warn-on-creation: tag: --force does not have to warn when creating tags
Diffstat (limited to 'builtin/tag.c')
-rw-r--r--builtin/tag.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/tag.c b/builtin/tag.c
index f8266888c..af3af3f64 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -582,7 +582,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
die(_("%s: cannot lock the ref"), ref.buf);
if (write_ref_sha1(lock, object, NULL) < 0)
die(_("%s: cannot update the ref"), ref.buf);
- if (force && hashcmp(prev, object))
+ if (force && !is_null_sha1(prev) && hashcmp(prev, object))
printf(_("Updated tag '%s' (was %s)\n"), tag, find_unique_abbrev(prev, DEFAULT_ABBREV));
strbuf_release(&buf);