]> git.ipfire.org Git - thirdparty/git.git/blobdiff - ref-filter.c
branch --list: print useful info whilst interactive rebasing a detached HEAD
[thirdparty/git.git] / ref-filter.c
index 45fc56216aaa8fd084a10514f6f4912878ab1627..d9ef7f0748366ae9e0f14a25b87d3a37cea8e7af 100644 (file)
@@ -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) {