Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'wt-status.c')
-rw-r--r--wt-status.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/wt-status.c b/wt-status.c
index 445a36204a..f4fa982638 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1006,13 +1006,19 @@ size_t wt_status_locate_end(const char *s, size_t len)
return len;
}
-void wt_status_add_cut_line(FILE *fp)
+void wt_status_append_cut_line(struct strbuf *buf)
{
const char *explanation = _("Do not modify or remove the line above.\nEverything below it will be ignored.");
+
+ strbuf_commented_addf(buf, "%s", cut_line);
+ strbuf_add_commented_lines(buf, explanation, strlen(explanation));
+}
+
+void wt_status_add_cut_line(FILE *fp)
+{
struct strbuf buf = STRBUF_INIT;
- fprintf(fp, "%c %s", comment_line_char, cut_line);
- strbuf_add_commented_lines(&buf, explanation, strlen(explanation));
+ wt_status_append_cut_line(&buf);
fputs(buf.buf, fp);
strbuf_release(&buf);
}
@@ -1851,7 +1857,7 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
color_fprintf(s->fp, branch_color_local, "%s", branch_name);
sti = stat_tracking_info(branch, &num_ours, &num_theirs, &base,
- s->ahead_behind_flags);
+ 0, s->ahead_behind_flags);
if (sti < 0) {
if (!base)
goto conclude;
@@ -1990,7 +1996,7 @@ static void wt_porcelain_v2_print_tracking(struct wt_status *s)
branch = branch_get(branch_name);
base = NULL;
ab_info = stat_tracking_info(branch, &nr_ahead, &nr_behind,
- &base, s->ahead_behind_flags);
+ &base, 0, s->ahead_behind_flags);
if (base) {
base = shorten_unambiguous_ref(base, 0);
fprintf(s->fp, "# branch.upstream %s%c", base, eol);