checkout: do not lose staged removal
[gitweb.git] / builtin-checkout.c
index f6f8f086de980b5bc19ca59985a2b0d8201831d9..774f29992a967201d1d4f39e6d2a9993d11a8eb7 100644 (file)
@@ -242,6 +242,8 @@ 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.update = 1;
                topts.merge = 1;
                topts.gently = opts->merge;