Skip to content

Commit 0ad6f1a

Browse files
committed
Merge branch 'mg/tag-d-show'
* mg/tag-d-show: tag -d: print sha1 of deleted tag
2 parents aec7de4 + 0a043b1 commit 0ad6f1a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

builtin-tag.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static int delete_tag(const char *name, const char *ref,
140140
{
141141
if (delete_ref(ref, sha1, 0))
142142
return 1;
143-
printf("Deleted tag '%s'\n", name);
143+
printf("Deleted tag '%s' (was %s)\n", name, find_unique_abbrev(sha1, DEFAULT_ABBREV));
144144
return 0;
145145
}
146146

@@ -479,6 +479,8 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
479479
die("%s: cannot lock the ref", ref);
480480
if (write_ref_sha1(lock, object, NULL) < 0)
481481
die("%s: cannot update the ref", ref);
482+
if (force && hashcmp(prev, object))
483+
printf("Updated tag '%s' (was %s)\n", tag, find_unique_abbrev(prev, DEFAULT_ABBREV));
482484

483485
strbuf_release(&buf);
484486
return 0;

0 commit comments

Comments
 (0)