git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/6] Remove duplicate code

From
Elijah Newren <newren@gmail.com>
Date
Apr 10, 2016, 06:13 UTC
Message-ID
<1460268820-8308-2-git-send-email-newren@gmail.com>
In-Reply-To
<1460268820-8308-1-git-send-email-newren@gmail.com>

In commit 51931bf (merge-recursive: Improve handling of rename target vs. directory addition, 2011-08-11) I apparently added two lines of code that were immediately duplicated a few lines later. No idea why, other than it seems pretty clear this was a mistake: there is no need to remove the same file twice; removing it once is sufficient...especially since the intervening line was working with a different file entirely.

Signed-off-by: Elijah Newren <newren@gmail.com>
Reviewed-by: Junio C Hamano <gitster@pobox.com>
---
 merge-recursive.c | 2 --
 1 file changed, 2 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index b880ae5..d4292de 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1773,8 +1773,6 @@ static int process_entry(struct merge_options *o,
 			output(o, 1, _("CONFLICT (%s): There is a directory with name %s in %s. "
 			       "Adding %s as %s"),
 			       conf, path, other_branch, path, new_path);
-			if (o->call_depth)
-				remove_file_from_cache(path);
 			update_file(o, 0, sha, mode, new_path);
 			if (o->call_depth)
 				remove_file_from_cache(path);
-- 
2.8.0.21.g229f62a
Previous: Elijah NewrenNext: Elijah Newren
Message 2 of 10 in “Miscellaneous merge fixes”
  1. 0/6 Miscellaneous merge fixesElijah Newren, Apr 10, 2016
  2. 1/6 Remove duplicate codeElijah Newren, Apr 10, 2016
  3. 2/6 Avoid checking working copy when creating a virtual merge baseElijah Newren, Apr 10, 2016
  4. Junio C HamanoApr 13, 2016
  5. 3/6 Add merge testcases for when index doesn't match HEADElijah Newren, Apr 10, 2016
  6. 4/6 merge-octopus: Abort if index does not match HEADElijah Newren, Apr 10, 2016
  7. 5/6 Add a testcase demonstrating a bug with trivial mergesElijah Newren, Apr 10, 2016
  8. 6/6 builtin/merge.c: Fix a bug with trivial mergesElijah Newren, Apr 10, 2016
  9. Junio C HamanoApr 13, 2016
  10. Elijah NewrenApr 15, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.