Commit eb4f3ad3e4ca2f06e2b92793d80b627965593f82

Stefan Sperling 2020-02-14T11:13:16

check for any symbolic refs and skip them, not just HEAD

diff --git a/gotweb/gotweb.c b/gotweb/gotweb.c
index 044dc9e..81e2a19 100644
--- a/gotweb/gotweb.c
+++ b/gotweb/gotweb.c
@@ -3099,9 +3099,10 @@ gw_get_commit(struct gw_trans *gw_trans, struct gw_header *header)
 		struct got_tag_object *tag = NULL;
 		int cmp;
 
-		name = got_ref_get_name(re->ref);
-		if (strcmp(name, GOT_REF_HEAD) == 0)
+		if (got_ref_is_symbolic(re->ref))
 			continue;
+
+		name = got_ref_get_name(re->ref);
 		if (strncmp(name, "refs/", 5) == 0)
 			name += 5;
 		if (strncmp(name, "got/", 4) == 0)
@@ -4002,6 +4003,9 @@ gw_output_repo_heads(struct gw_trans *gw_trans)
 	SIMPLEQ_FOREACH(re, &refs, entry) {
 		char *refname;
 
+		if (got_ref_is_symbolic(re->ref))
+			continue;
+
 		refname = strdup(got_ref_get_name(re->ref));
 		if (refname == NULL) {
 			error = got_error_from_errno("got_ref_to_str");