diff options
Diffstat (limited to 'wt-status.c')
-rw-r--r-- | wt-status.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/wt-status.c b/wt-status.c index 77c27c5113..93ac645225 100644 --- a/wt-status.c +++ b/wt-status.c @@ -121,15 +121,13 @@ static void status_printf_more(struct wt_status *s, const char *color, void wt_status_prepare(struct wt_status *s) { - struct object_id oid; - memset(s, 0, sizeof(*s)); memcpy(s->color_palette, default_wt_status_colors, sizeof(default_wt_status_colors)); s->show_untracked_files = SHOW_NORMAL_UNTRACKED_FILES; s->use_color = -1; s->relative_paths = 1; - s->branch = resolve_refdup("HEAD", 0, oid.hash, NULL); + s->branch = resolve_refdup("HEAD", 0, NULL, NULL); s->reference = "HEAD"; s->fp = stdout; s->index_file = get_index_file(); @@ -934,7 +932,7 @@ size_t wt_status_locate_end(const char *s, size_t len) void wt_status_add_cut_line(FILE *fp) { - const char *explanation = _("Do not touch the line above.\nEverything below will be removed."); + const char *explanation = _("Do not modify or remove the line above.\nEverything below it will be ignored."); struct strbuf buf = STRBUF_INIT; fprintf(fp, "%c %s", comment_line_char, cut_line); @@ -1026,6 +1024,7 @@ static void wt_longstatus_print_tracking(struct wt_status *s) comment_line_char); else fputs("\n", s->fp); + strbuf_release(&sb); } static int has_unmerged(struct wt_status *s) @@ -1193,6 +1192,7 @@ static int read_rebase_todolist(const char *fname, struct string_list *lines) string_list_append(lines, line.buf); } fclose(f); + strbuf_release(&line); return 0; } @@ -2297,14 +2297,14 @@ int has_uncommitted_changes(int ignore_submodules) */ int require_clean_work_tree(const char *action, const char *hint, int ignore_submodules, int gently) { - struct lock_file *lock_file = xcalloc(1, sizeof(*lock_file)); + struct lock_file lock_file = LOCK_INIT; int err = 0, fd; - fd = hold_locked_index(lock_file, 0); + fd = hold_locked_index(&lock_file, 0); refresh_cache(REFRESH_QUIET); if (0 <= fd) - update_index_if_able(&the_index, lock_file); - rollback_lock_file(lock_file); + update_index_if_able(&the_index, &lock_file); + rollback_lock_file(&lock_file); if (has_unstaged_changes(ignore_submodules)) { /* TRANSLATORS: the action is e.g. "pull with rebase" */ |