[Pkg-cgit-commits] [pkg-cgit] 46/49: Remove unused patch
Peter Colberg
peter at colberg.org
Thu Jun 16 01:49:22 UTC 2016
This is an automated email from the git hooks/post-receive script.
pc-guest pushed a commit to branch master
in repository pkg-cgit.
commit 61fed05c785ef60b38a2a540fc1bbd940a4bd598
Author: Alexander Wirt <formorer at debian.org>
Date: Tue Mar 1 14:10:31 2016 +0100
Remove unused patch
---
debian/patches/fix_status_code_for_unknown_repos | 102 -----------------------
1 file changed, 102 deletions(-)
diff --git a/debian/patches/fix_status_code_for_unknown_repos b/debian/patches/fix_status_code_for_unknown_repos
deleted file mode 100644
index cb7f08d..0000000
--- a/debian/patches/fix_status_code_for_unknown_repos
+++ /dev/null
@@ -1,102 +0,0 @@
-From: Nicolas Dandrimont <nicolas.dandrimont at crans.org>
-Date: Thu, 31 Jul 2014 20:30:03 +0200
-Subject: Return a proper status code when there is no repository found
-
----
- tests/t0112-no-repo-found.sh | 10 +++++++++
- ui-repolist.c | 51 +++++++++++++++++++++++++++++++++-----------
- 2 files changed, 48 insertions(+), 13 deletions(-)
- create mode 100755 tests/t0112-no-repo-found.sh
-
---- /dev/null
-+++ b/tests/t0112-no-repo-found.sh
-@@ -0,0 +1,12 @@
-+#!/bin/sh
-+
-+test_description='Check index page when trying a non-existing repo'
-+. ./setup.sh
-+
-+test_expect_success 'generate index page' 'cgit_url "/no-repo-there" >tmp'
-+test_expect_success 'verify "No repositories found" message' 'grep "No repositories found" tmp'
-+test_expect_success 'verify status code is 404' 'head -1 tmp | grep "Status: 404"'
-+test_expect_success 'verify there is no tree link' '! grep /tree/ tmp'
-+test_expect_success 'verify there is no log link' '! grep /log/ tmp'
-+
-+test_done
---- a/ui-repolist.c
-+++ b/ui-repolist.c
-@@ -272,22 +272,48 @@
-
- void cgit_print_repolist(void)
- {
-- int i, columns = 3, hits = 0, header = 0;
-+ int i, columns = 3, hits = 0, header = 0, found_repos = 0, matched_size = 0;
- char *last_section = NULL;
- char *section;
- int sorted = 0;
-+ struct cgit_repo *repo = NULL;
-+ struct cgit_repo **matched_repos = NULL;
-
- if (!any_repos_visible()) {
- cgit_print_error_page(404, "Not found", "No repositories found");
- return;
- }
-
-+ if (ctx.qry.sort)
-+ sorted = sort_repolist(ctx.qry.sort);
-+ else if (ctx.cfg.section_sort)
-+ sort_repolist("section");
-+
-+ for (i = 0; i < cgit_repolist.count; i++) {
-+ repo = &cgit_repolist.repos[i];
-+ if (!(is_match(repo) && is_in_url(repo)))
-+ continue;
-+ if (++found_repos > matched_size) {
-+ if (matched_size == 0)
-+ matched_size = 8;
-+ else
-+ matched_size *= 2;
-+ matched_repos = xrealloc(matched_repos,
-+ matched_size *
-+ sizeof(struct cgit_repo *));
-+ }
-+ matched_repos[found_repos-1] = repo;
-+ }
-+
- if (ctx.cfg.enable_index_links)
- ++columns;
- if (ctx.cfg.enable_index_owner)
- ++columns;
-
- ctx.page.title = ctx.cfg.root_title;
-+ if (!found_repos)
-+ ctx.page.status = 404;
-+
- cgit_print_http_headers();
- cgit_print_docstart();
- cgit_print_pageheader();
-@@ -301,11 +327,9 @@
- sort_repolist("section");
-
- html("<table summary='repository list' class='list nowrap'>");
-- for (i = 0; i < cgit_repolist.count; i++) {
-- ctx.repo = &cgit_repolist.repos[i];
-- if (!is_visible(ctx.repo))
-- continue;
-- hits++;
-+ for (hits = 1; hits <= found_repos; hits++) {
-+ ctx.repo = matched_repos[hits-1];
-+
- if (hits <= ctx.qry.ofs)
- continue;
- if (hits > ctx.qry.ofs + ctx.cfg.max_repo_count)
-@@ -365,7 +389,9 @@
- html("</table>");
- if (hits > ctx.cfg.max_repo_count)
- print_pager(hits, ctx.cfg.max_repo_count, ctx.qry.search, ctx.qry.sort);
-+docend:
- cgit_print_docend();
-+ free(matched_repos);
- }
-
- void cgit_print_site_readme(void)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-cgit/pkg-cgit.git
More information about the Pkg-cgit-commits
mailing list