Commit 79cc719fb21cd573f0b669dddf501e3fa5b389fe

Stefan Sperling 2020-04-24T16:31:55

filter out "remote/*/HEAD" references in tog log view

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/tog/tog.c b/tog/tog.c
index ce5000c..59e36d0 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -1173,8 +1173,12 @@ build_refs_str(char **refs_str, struct got_reflist_head *refs,
 			continue;
 		if (strncmp(name, "heads/", 6) == 0)
 			name += 6;
-		if (strncmp(name, "remotes/", 8) == 0)
+		if (strncmp(name, "remotes/", 8) == 0) {
 			name += 8;
+			s = strstr(name, "/" GOT_REF_HEAD);
+			if (s != NULL && s[strlen(s)] == '\0')
+				continue;
+		}
 		if (strncmp(name, "tags/", 5) == 0) {
 			err = got_object_open_as_tag(&tag, repo, re->id);
 			if (err) {