diff options
Diffstat (limited to 'builtin/checkout.c')
-rw-r--r-- | builtin/checkout.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index a52af2e507..ca6aa29794 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -484,7 +484,7 @@ static int merge_working_tree(const struct checkout_opts *opts, resolve_undo_clear(); if (opts->force) { - ret = reset_tree(new_branch_info->commit->tree, opts, 1, writeout_error); + ret = reset_tree(new_branch_info->commit->maybe_tree, opts, 1, writeout_error); if (ret) return ret; } else { @@ -570,18 +570,18 @@ static int merge_working_tree(const struct checkout_opts *opts, o.verbosity = 0; work = write_tree_from_memory(&o); - ret = reset_tree(new_branch_info->commit->tree, opts, 1, + ret = reset_tree(new_branch_info->commit->maybe_tree, opts, 1, writeout_error); if (ret) return ret; o.ancestor = old_branch_info->name; o.branch1 = new_branch_info->name; o.branch2 = "local"; - ret = merge_trees(&o, new_branch_info->commit->tree, work, - old_branch_info->commit->tree, &result); + ret = merge_trees(&o, new_branch_info->commit->maybe_tree, work, + old_branch_info->commit->maybe_tree, &result); if (ret < 0) exit(128); - ret = reset_tree(new_branch_info->commit->tree, opts, 0, + ret = reset_tree(new_branch_info->commit->maybe_tree, opts, 0, writeout_error); strbuf_release(&o.obuf); if (ret) @@ -1002,7 +1002,7 @@ static int parse_branchname_arg(int argc, const char **argv, *source_tree = parse_tree_indirect(rev); } else { parse_commit_or_die(new_branch_info->commit); - *source_tree = new_branch_info->commit->tree; + *source_tree = new_branch_info->commit->maybe_tree; } if (!*source_tree) /* case (1): want a tree */ |