Skip to content

Commit acb7da0

Browse files
newrengitster
authored andcommitted
checkout: remove duplicate code
Both commit a7256de ("checkout.txt: note about losing staged changes with --merge", 2019-03-19) from nd/checkout-m-doc-update and commit 6eff409 ("checkout: prevent losing staged changes with --merge", 2019-03-22) from nd/checkout-m were included in git.git despite the fact that the latter was meant to be v2 of the former. The merge of these two topics resulted in a redundant chunk of code; remove it. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4a3ed2b commit acb7da0

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

builtin/checkout.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -745,13 +745,6 @@ static int merge_working_tree(const struct checkout_opts *opts,
745745
"the following files:\n%s"), sb.buf);
746746
strbuf_release(&sb);
747747

748-
if (repo_index_has_changes(the_repository,
749-
get_commit_tree(old_branch_info->commit),
750-
&sb))
751-
warning(_("staged changes in the following files may be lost: %s"),
752-
sb.buf);
753-
strbuf_release(&sb);
754-
755748
/* Do more real merge */
756749

757750
/*

0 commit comments

Comments
 (0)