summaryrefslogtreecommitdiff
path: root/builtin/checkout.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-06-08 18:06:30 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-06-08 18:06:30 -0700
commitded44afa023c981d803b56f42284ed0597a174ee (patch)
treec8ae180f8155772f3d476598564cd901cc2a9e61 /builtin/checkout.c
parentMerge branch 'vs/complete-stash-show-p-fix' (diff)
parentt2060: add a test for switch with --orphan and --discard-changes (diff)
downloadtgif-ded44afa023c981d803b56f42284ed0597a174ee.tar.xz
Merge branch 'bc/filter-process'
Code simplification and test coverage enhancement. * bc/filter-process: t2060: add a test for switch with --orphan and --discard-changes builtin/checkout: simplify metadata initialization
Diffstat (limited to 'builtin/checkout.c')
-rw-r--r--builtin/checkout.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 24336e1017..af849c644f 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -621,9 +621,7 @@ static int reset_tree(struct tree *tree, const struct checkout_opts *o,
opts.src_index = &the_index;
opts.dst_index = &the_index;
init_checkout_metadata(&opts.meta, info->refname,
- info->commit ? &info->commit->object.oid :
- is_null_oid(&info->oid) ? &tree->object.oid :
- &info->oid,
+ info->commit ? &info->commit->object.oid : &null_oid,
NULL);
parse_tree(tree);
init_tree_desc(&tree_desc, tree->buffer, tree->size);