Skip to contentSkip to conversation

Remove uneccessarily similar printf() from print_ref_list()

PATCH In review Andy Parkins 1 participant 1 message Aug 11, 2016

lore
Share & tools
lore
#0 lore raw

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

---
 builtin-branch.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
builtin-branch.c +5 -3
index e028a53..368b68e 100644
@@ -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]);
 	}
 }
 
Signature · 1 line
1.4.3.2