Merge branch 'en/checkout-mismerge-fix'
authorJunio C Hamano <gitster@pobox.com>
Mon, 9 Sep 2019 19:26:36 +0000 (12:26 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Sep 2019 19:26:36 +0000 (12:26 -0700)
Fix a mismerge that happened in 2.22 timeframe.

* en/checkout-mismerge-fix:
checkout: remove duplicate code

builtin/checkout.c
index 8d3ad7cd9e735fdece09793ec11995e7b91b5c6f..0a3679eb776ec962d943f3d1902c9c6e7f1feea7 100644 (file)
@@ -731,13 +731,6 @@ static int merge_working_tree(const struct checkout_opts *opts,
                                      "the following files:\n%s"), sb.buf);
                        strbuf_release(&sb);
 
-                       if (repo_index_has_changes(the_repository,
-                                                  get_commit_tree(old_branch_info->commit),
-                                                  &sb))
-                               warning(_("staged changes in the following files may be lost: %s"),
-                                       sb.buf);
-                       strbuf_release(&sb);
-
                        /* Do more real merge */
 
                        /*