summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2012-10-18 12:08:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-10-18 21:36:17 (GMT)
commit13baa9fe866f63311af5a5ee318beddb16eb5df4 (patch)
treecc50b33e17a4ed48860c96fb7757a417e3ff34d0 /builtin
parent0fe700e311f2d7e55eb23fe941fab9155d7f91df (diff)
downloadgit-13baa9fe866f63311af5a5ee318beddb16eb5df4.zip
git-13baa9fe866f63311af5a5ee318beddb16eb5df4.tar.gz
git-13baa9fe866f63311af5a5ee318beddb16eb5df4.tar.bz2
branch: show targets of deleted symrefs, not sha1s
git branch reports the abbreviated hash of the head commit of a deleted branch to make it easier for a user to undo the operation. For symref branches this doesn't help. Print the symref target instead for them. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/branch.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/builtin/branch.c b/builtin/branch.c
index d87035a..1ec9c02 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -251,15 +251,18 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
: _("Error deleting branch '%s'"),
bname.buf);
ret = 1;
- } else {
- if (!quiet)
- printf(remote_branch
- ? _("Deleted remote branch %s (was %s).\n")
- : _("Deleted branch %s (was %s).\n"),
- bname.buf,
- find_unique_abbrev(sha1, DEFAULT_ABBREV));
- delete_branch_config(bname.buf);
+ continue;
+ }
+ if (!quiet) {
+ printf(remote_branch
+ ? _("Deleted remote branch %s (was %s).\n")
+ : _("Deleted branch %s (was %s).\n"),
+ bname.buf,
+ (flags & REF_ISSYMREF)
+ ? target
+ : find_unique_abbrev(sha1, DEFAULT_ABBREV));
}
+ delete_branch_config(bname.buf);
}
free(name);