]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin-checkout.c
checkout: Fix "initial checkout" detection
[thirdparty/git.git] / builtin-checkout.c
index 05eee4ecc71d7a20d9faf59c849d3c693ae4cc8d..25845cdd5e6ed47a726b4be57929b9ec4d348fff 100644 (file)
@@ -269,8 +269,7 @@ static int merge_working_tree(struct checkout_opts *opts,
                }
 
                /* 2-way merge to the new branch */
-               topts.initial_checkout = (!active_nr &&
-                                         (old->commit == new->commit));
+               topts.initial_checkout = is_cache_unborn();
                topts.update = 1;
                topts.merge = 1;
                topts.gently = opts->merge;