diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-04-03 09:24:51 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-03 09:24:51 -0700 |
commit | 9e72a566995ae84862a341e3a149a4bcaf96385d (patch) | |
tree | f53c9a3aace2761495734789299c447f2d04f227 /builtin | |
parent | fa0a6a48233d9dd1e72ef3fe13166871a18d7714 (diff) | |
parent | 3ae851e6fbb4e99fa7281d18a5c6f95a3fb6d998 (diff) | |
download | git-9e72a566995ae84862a341e3a149a4bcaf96385d.tar.gz |
Merge branch 'ph/tag-force-no-warn-on-creation' into maint
"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')
-rw-r--r-- | builtin/tag.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/tag.c b/builtin/tag.c index f8266888cc..af3af3f649 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); |