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

[PATCH 1/4] Remove uneccessarily similar printf() from print_ref_list()

From
APAndy Parkins <andyparkins@gmail.com>
Date
Nov 2, 2006, 11:10 UTC
Message-ID
<200611021110.52952.andyparkins@gmail.com>
Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---
 builtin-branch.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/builtin-branch.c b/builtin-branch.c
index e028a53..368b68e 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -103,6 +103,7 @@ static int ref_cmp(const void *r1, const
 static void print_ref_list(int remote_only)
 {
 	int i;
+	char c;
 
 	if (remote_only)
 		for_each_remote_ref(append_ref, NULL);
@@ -112,10 +113,11 @@ static void print_ref_list(int remote_on
 	qsort(ref_list, ref_index, sizeof(char *), ref_cmp);
 
 	for (i = 0; i < ref_index; i++) {
+		c = ' ';
 		if (!strcmp(ref_list[i], head))
-			printf("* %s\n", ref_list[i]);
-		else
-			printf("  %s\n", ref_list[i]);
+			c = '*';
+
+		printf("%c %s\n", c, ref_list[i]);
 	}
 }
 
-- 
1.4.3.2
Message 1 of 1 in “Remove uneccessarily similar printf() from print_ref_list()”
  1. 1/4 Remove uneccessarily similar printf() from print_ref_list()Andy Parkins, Nov 2, 2006

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.