Merge branch 'jk/test-send-sh-x-trace-elsewhere' into maint
[gitweb.git] / wt-status.c
index bba25960b4e3c54a7c1d8861ea895fbe01aa3110..1ea2ebe4c00d23885515ac48f43844fdb03f70b9 100644 (file)
@@ -988,7 +988,7 @@ static char *read_line_from_git_path(const char *filename)
                strbuf_release(&buf);
                return NULL;
        }
-       strbuf_getline(&buf, fp, '\n');
+       strbuf_getline_lf(&buf, fp);
        if (!fclose(fp)) {
                return strbuf_detach(&buf, NULL);
        } else {
@@ -1063,9 +1063,7 @@ static void abbrev_sha1_in_line(struct strbuf *line)
                                strbuf_addf(line, "%s", split[i]->buf);
                }
        }
-       for (i = 0; split[i]; i++)
-               strbuf_release(split[i]);
-
+       strbuf_list_free(split);
 }
 
 static void read_rebase_todolist(const char *fname, struct string_list *lines)
@@ -1076,7 +1074,7 @@ static void read_rebase_todolist(const char *fname, struct string_list *lines)
        if (!f)
                die_errno("Could not open file %s for reading",
                          git_path("%s", fname));
-       while (!strbuf_getline(&line, f, '\n')) {
+       while (!strbuf_getline_lf(&line, f)) {
                if (line.len && line.buf[0] == comment_line_char)
                        continue;
                strbuf_trim(&line);
@@ -1677,10 +1675,10 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
                color_fprintf(s->fp, header_color, LABEL(N_("behind ")));
                color_fprintf(s->fp, branch_color_remote, "%d", num_theirs);
        } else if (!num_theirs) {
-               color_fprintf(s->fp, header_color, LABEL(N_(("ahead "))));
+               color_fprintf(s->fp, header_color, LABEL(N_("ahead ")));
                color_fprintf(s->fp, branch_color_local, "%d", num_ours);
        } else {
-               color_fprintf(s->fp, header_color, LABEL(N_(("ahead "))));
+               color_fprintf(s->fp, header_color, LABEL(N_("ahead ")));
                color_fprintf(s->fp, branch_color_local, "%d", num_ours);
                color_fprintf(s->fp, header_color, ", %s", LABEL(N_("behind ")));
                color_fprintf(s->fp, branch_color_remote, "%d", num_theirs);