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

[PATCH] Make rev_compare_tree less confusing.

From
Bo Yang <struggleyb.nku@gmail.com>
Date
Apr 15, 2010, 08:46 UTC
Message-ID
<1271321171-12176-1-git-send-email-struggleyb.nku@gmail.com>

diff_tree_sha1 always return 0, so comparing the return value of it make no sense. Just delete the comparison to make code reader clear.

Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>
---
 revision.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/revision.c b/revision.c
index f4b8b38..8caca99 100644
--- a/revision.c
+++ b/revision.c
@@ -329,9 +329,7 @@ static int rev_compare_tree(struct rev_info *revs, struct commit *parent, struct
 
 	tree_difference = REV_TREE_SAME;
 	DIFF_OPT_CLR(&revs->pruning, HAS_CHANGES);
-	if (diff_tree_sha1(t1->object.sha1, t2->object.sha1, "",
-			   &revs->pruning) < 0)
-		return REV_TREE_DIFFERENT;
+	diff_tree_sha1(t1->object.sha1, t2->object.sha1, "", &revs->pruning);
 	return tree_difference;
 }
 
-- 
1.6.0.4
Next: Thomas Rast
Message 1 of 3 in “Make rev_compare_tree less confusing.”
  1. Make rev_compare_tree less confusing.Bo Yang, Apr 15, 2010
  2. Thomas RastApr 16, 2010
  3. Junio C HamanoApr 16, 2010

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.