summaryrefslogtreecommitdiff
path: root/builtin-checkout.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-checkout.c')
-rw-r--r--builtin-checkout.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/builtin-checkout.c b/builtin-checkout.c
index 20b34ce..fc55bbe 100644
--- a/builtin-checkout.c
+++ b/builtin-checkout.c
@@ -295,6 +295,8 @@ static void show_local_changes(struct object *head)
init_revisions(&rev, NULL);
rev.abbrev = 0;
rev.diffopt.output_format |= DIFF_FORMAT_NAME_STATUS;
+ if (diff_setup_done(&rev.diffopt) < 0)
+ die("diff_setup_done failed");
add_pending_object(&rev, head, NULL);
run_diff_index(&rev, 0);
}
@@ -405,7 +407,7 @@ static int merge_working_tree(struct checkout_opts *opts,
topts.verbose_update = !opts->quiet;
topts.fn = twoway_merge;
topts.dir = xcalloc(1, sizeof(*topts.dir));
- topts.dir->show_ignored = 1;
+ topts.dir->flags |= DIR_SHOW_IGNORED;
topts.dir->exclude_per_dir = ".gitignore";
tree = parse_tree_indirect(old->commit->object.sha1);
init_tree_desc(&trees[0], tree->buffer, tree->size);
@@ -556,8 +558,8 @@ static int switch_branches(struct checkout_opts *opts, struct branch_info *new)
if (!old.commit && !opts->force) {
if (!opts->quiet) {
- fprintf(stderr, "warning: You appear to be on a branch yet to be born.\n");
- fprintf(stderr, "warning: Forcing checkout of %s.\n", new->name);
+ warning("You appear to be on a branch yet to be born.");
+ warning("Forcing checkout of %s.", new->name);
}
opts->force = 1;
}