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

[PATCH] format-patch: trivial cleanup

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Apr 7, 2013, 07:18 UTC
Message-ID
<1365319139-12362-1-git-send-email-felipe.contreras@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
Actually, now that we are on it. After applying my latest patch series, this makes sense.
 builtin/log.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/builtin/log.c b/builtin/log.c
index fab7998..7cf9277 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -1058,12 +1058,10 @@ static char *find_branch_name(struct rev_info *rev)
 		else
 			return NULL;
 	}
-	if (0 <= positive) {
-		ref = rev->cmdline.rev[positive].name;
-		tip_sha1 = rev->cmdline.rev[positive].item->sha1;
-	} else {
+	if (positive < 0)
 		return NULL;
-	}
+	ref = rev->cmdline.rev[positive].name;
+	tip_sha1 = rev->cmdline.rev[positive].item->sha1;
 	if (dwim_ref(ref, strlen(ref), branch_sha1, &full_ref) &&
 	    !prefixcmp(full_ref, "refs/heads/") &&
 	    !hashcmp(tip_sha1, branch_sha1))
-- 
1.8.2
Next: Junio C Hamano
Message 1 of 2 in “format-patch: trivial cleanup”
  1. format-patch: trivial cleanupFelipe Contreras, Apr 7, 2013
  2. Junio C HamanoApr 7, 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.