Commit 4343a07f8a7ed7d12a233c873a417b38b555e200

Stefan Sperling 2020-04-24T16:33:32

filter out "remote/*/HEAD" references in 'got log' output

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/got/got.c b/got/got.c
index cce99fd..7bf9457 100644
--- a/got/got.c
+++ b/got/got.c
@@ -3047,8 +3047,12 @@ print_commit(struct got_commit_object *commit, struct got_object_id *id,
 			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) {