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

[PATCH 1/3] merge-recursive: remove dead conditional in update_stages()

From
Thomas Rast <trast@inf.ethz.ch>
Date
Jul 7, 2013, 18:02 UTC
Message-ID
<ed085382b2966c91b59234537564e881ea9e6e4d.1373219466.git.trast@inf.ethz.ch>
In-Reply-To
<cover.1373219466.git.trast@inf.ethz.ch>

650467c (merge-recursive: Consolidate different update_stages functions, 2011-08-11) changed the former argument 'clear' to always be true. Remove the useless conditional.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
---
 merge-recursive.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index ea9dbd3..0b9cafb 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -544,11 +544,9 @@ static int update_stages(const char *path, const struct diff_filespec *o,
 	 * would_lose_untracked).  Instead, reverse the order of the calls
 	 * (executing update_file first and then update_stages).
 	 */
-	int clear = 1;
 	int options = ADD_CACHE_OK_TO_ADD | ADD_CACHE_SKIP_DFCHECK;
-	if (clear)
-		if (remove_file_from_cache(path))
-			return -1;
+	if (remove_file_from_cache(path))
+		return -1;
 	if (o)
 		if (add_cacheinfo(o->mode, o->sha1, path, 1, 0, options))
 			return -1;
-- 
1.8.3.2.908.gbd0dbd0
Previous: Thomas RastNext: Thomas Rast
Message 2 of 15 in “merge -Xindex-only”
  1. 0/3 merge -Xindex-onlyThomas Rast, Jul 7, 2013
  2. 1/3 merge-recursive: remove dead conditional in update_stages()Thomas Rast, Jul 7, 2013
  3. 2/3 merge-recursive: untangle double meaning of o->call_depthThomas Rast, Jul 7, 2013
  4. Junio C HamanoJul 7, 2013
  5. 3/3 merge-recursive: -Xindex-only to leave worktree unchangedThomas Rast, Jul 7, 2013
  6. Michael HaggertyJul 8, 2013
  7. Thomas RastJul 8, 2013
  8. Michael HaggertyJul 9, 2013
  9. Thomas RastJul 9, 2013
  10. Michael HaggertyJul 9, 2013
  11. Thomas RastJul 9, 2013
  12. Thomas RastOct 26, 2013
  13. 1/3 merge-recursive: remove dead conditional in update_stages()Thomas Rast, Oct 26, 2013
  14. 2/3 merge-recursive: internal flag to avoid touching the worktreeThomas Rast, Oct 26, 2013
  15. 3/3 merge-recursive: -Xindex-only to leave worktree unchangedThomas Rast, Oct 26, 2013

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.