commit d4982225ffedbeafcf28f1cb9363f4f1c9798512 from: Omar Polo date: Sat Sep 07 08:50:13 2024 UTC gotwebd: unbreak tags rendering if qs->commit is set got_get_repo_tags interprets it as an index for the tags, i.e. to skip tags until one with that id is found. So we can't set qs->commit (intended to unbreak the README links) before it, we have to do it afterwards. ok stsp@ commit - e4caa658300a7add4b5ea31badafdbec0dc733f7 commit + d4982225ffedbeafcf28f1cb9363f4f1c9798512 blob - fb2894f0a49e2ecb0e12069bb4354470e9c06e32 blob + cc06209b1e8c52eb8460afa45b05725c2650d9e2 --- gotwebd/gotweb.c +++ gotwebd/gotweb.c @@ -353,7 +353,15 @@ gotweb_process_request(struct request *c) } error = got_get_repo_commits(c, srv->summary_commits_display); if (error) + goto err; + qs->action = TAGS; + error = got_get_repo_tags(c, srv->summary_tags_display); + if (error) { + log_warnx("%s: got_get_repo_tags: %s", __func__, + error->msg); goto err; + } + qs->action = SUMMARY; commit = TAILQ_FIRST(&c->t->repo_commits); if (commit && qs->commit == NULL) { qs->commit = strdup(commit->commit_id); @@ -362,15 +370,7 @@ gotweb_process_request(struct request *c) log_warn("%s: strdup", __func__); goto err; } - } - qs->action = TAGS; - error = got_get_repo_tags(c, srv->summary_tags_display); - if (error) { - log_warnx("%s: got_get_repo_tags: %s", __func__, - error->msg); - goto err; } - qs->action = SUMMARY; if (gotweb_reply(c, 200, "text/html", NULL) == -1) return; gotweb_render_page(c->tp, gotweb_render_summary);