Commit abdd569e31cd50e202d93eb3900ce5b227869718

Stefan Sperling 2020-09-23T11:41:52

skip remote HEAD refs in gotweb's gw_get_commit(); matches got and tog

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/gotweb/gotweb.c b/gotweb/gotweb.c
index 9a08db8..e0c4b29 100644
--- a/gotweb/gotweb.c
+++ b/gotweb/gotweb.c
@@ -3525,8 +3525,12 @@ gw_get_commit(struct gw_trans *gw_trans, struct gw_header *header,
 			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;
+		}
 		error = got_ref_resolve(&ref_id, gw_trans->repo, re->ref);
 		if (error)
 			return error;