http: respect protocol.*.allow=user for http-alternates
[gitweb.git] / wt-status.c
index ce5080c1a2ca18095534ec4b0e71019300a4b605..b96be25966c32c0e7a5d1521955a5fdf89462288 100644 (file)
@@ -947,10 +947,14 @@ static void show_merge_in_progress(struct wt_status *s,
 {
        if (has_unmerged(s)) {
                status_printf_ln(s, color, _("You have unmerged paths."));
-               if (s->hints)
+               if (s->hints) {
+                       status_printf_ln(s, color,
+                                        _("  (fix conflicts and run \"git commit\")"));
                        status_printf_ln(s, color,
-                               _("  (fix conflicts and run \"git commit\")"));
+                                        _("  (use \"git merge --abort\" to abort the merge)"));
+               }
        } else {
+               s-> commitable = 1;
                status_printf_ln(s, color,
                        _("All conflicts fixed but you are still merging."));
                if (s->hints)
@@ -1061,7 +1065,7 @@ static void abbrev_sha1_in_line(struct strbuf *line)
                        strbuf_addf(split[1], "%s ", abbrev);
                        strbuf_reset(line);
                        for (i = 0; split[i]; i++)
-                               strbuf_addf(line, "%s", split[i]->buf);
+                               strbuf_addbuf(line, split[i]);
                }
        }
        strbuf_list_free(split);
@@ -1296,11 +1300,6 @@ static char *get_branch(const struct worktree *wt, const char *path)
        return NULL;
 }
 
-static char *read_and_strip_branch(const char *path)
-{
-       return get_branch(NULL, path);
-}
-
 struct grab_1st_switch_cbdata {
        struct strbuf buf;
        unsigned char nsha1[20];
@@ -1393,6 +1392,19 @@ int wt_status_check_rebase(const struct worktree *wt,
        return 1;
 }
 
+int wt_status_check_bisect(const struct worktree *wt,
+                          struct wt_status_state *state)
+{
+       struct stat st;
+
+       if (!stat(worktree_git_path(wt, "BISECT_LOG"), &st)) {
+               state->bisect_in_progress = 1;
+               state->branch = get_branch(wt, "BISECT_START");
+               return 1;
+       }
+       return 0;
+}
+
 void wt_status_get_state(struct wt_status_state *state,
                         int get_detached_from)
 {
@@ -1408,10 +1420,7 @@ void wt_status_get_state(struct wt_status_state *state,
                state->cherry_pick_in_progress = 1;
                hashcpy(state->cherry_pick_head_sha1, sha1);
        }
-       if (!stat(git_path("BISECT_LOG"), &st)) {
-               state->bisect_in_progress = 1;
-               state->branch = read_and_strip_branch("BISECT_START");
-       }
+       wt_status_check_bisect(NULL, state);
        if (!stat(git_path_revert_head(), &st) &&
            !get_sha1("REVERT_HEAD", sha1)) {
                state->revert_in_progress = 1;
@@ -1548,7 +1557,7 @@ void wt_status_print(struct wt_status *s)
                        else
                                printf(_("nothing to commit\n"));
                } else
-                       printf(_("nothing to commit, working directory clean\n"));
+                       printf(_("nothing to commit, working tree clean\n"));
        }
 }