summaryrefslogtreecommitdiff
path: root/ref-filter.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-04-25 04:28:53 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-25 04:28:54 (GMT)
commit4cbaa6b47fbdcf68bd06d4a6ebf550153fb18636 (patch)
tree321705992c4cbb3b4636258be1c612bb541223b5 /ref-filter.c
parente6986abb7726cff889d333ffef4c58176a8db4c1 (diff)
parent1f537be3f21ce1289c5c3ed9ebf58f02938ad9f7 (diff)
downloadgit-4cbaa6b47fbdcf68bd06d4a6ebf550153fb18636.zip
git-4cbaa6b47fbdcf68bd06d4a6ebf550153fb18636.tar.gz
git-4cbaa6b47fbdcf68bd06d4a6ebf550153fb18636.tar.bz2
Merge branch 'ks/branch-list-detached-rebase-i'
"git branch --list" during an interrupted "rebase -i" now lets users distinguish the case where a detached HEAD is being rebased and a normal branch is being rebased. * ks/branch-list-detached-rebase-i: t3200: verify "branch --list" sanity when rebasing from detached HEAD branch --list: print useful info whilst interactive rebasing a detached HEAD
Diffstat (limited to 'ref-filter.c')
-rw-r--r--ref-filter.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/ref-filter.c b/ref-filter.c
index 9a333e2..a847838 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -1309,10 +1309,14 @@ char *get_head_description(void)
memset(&state, 0, sizeof(state));
wt_status_get_state(&state, 1);
if (state.rebase_in_progress ||
- state.rebase_interactive_in_progress)
- strbuf_addf(&desc, _("(no branch, rebasing %s)"),
- state.branch);
- else if (state.bisect_in_progress)
+ state.rebase_interactive_in_progress) {
+ if (state.branch)
+ strbuf_addf(&desc, _("(no branch, rebasing %s)"),
+ state.branch);
+ else
+ strbuf_addf(&desc, _("(no branch, rebasing detached HEAD %s)"),
+ state.detached_from);
+ } else if (state.bisect_in_progress)
strbuf_addf(&desc, _("(no branch, bisect started on %s)"),
state.branch);
else if (state.detached_from) {