about summary refs log tree commit diff
path: root/cgit.c
diff options
context:
space:
mode:
authorLukas Fleischer <cgit@cryptocrack.de>2014-07-27 20:50:59 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2014-08-07 14:38:02 +0200
commit9dd67272ed57e8923510197eb5ac8d3f819fbb26 (patch)
tree395d89b92be73223a430e7dff2c352fed05e51ab /cgit.c
parentcgitrc.5: we mean a cgi response, not request (diff)
downloadcgit-pink-9dd67272ed57e8923510197eb5ac8d3f819fbb26.tar.gz
cgit-pink-9dd67272ed57e8923510197eb5ac8d3f819fbb26.zip
Always check if README exists in choose_readme()
Specifying a nonexistent README file via the readme option is sometimes
useful, e.g. when using scan-path and setting a global default.
Currently, we check whether there is only one option in the readme
option and, if so, we choose that file without checking whether it
exists. As a consequence, all repositories are equipped with an about
link in the aforementioned scenario, even if there is no about file.
Remove the early check for the number of keys and always check whether
the file exists instead.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
Diffstat (limited to 'cgit.c')
-rw-r--r--cgit.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/cgit.c b/cgit.c
index 20f6e27..8c4517d 100644
--- a/cgit.c
+++ b/cgit.c
@@ -504,12 +504,6 @@ static void choose_readme(struct cgit_repo *repo)
 			free(ref);
 			continue;
 		}
-		/* If there's only one item, we skip the possibly expensive
-		 * selection process. */
-		if (repo->readme.nr == 1) {
-			found = 1;
-			break;
-		}
 		if (ref) {
 			if (cgit_ref_path_exists(filename, ref, 1)) {
 				found = 1;
span>Persist bright across color changesJune McEnroe 2017-07-30Add index.htmlJune McEnroe 2017-07-30Add snapshot.shJune McEnroe 2017-07-30Fix termcap patch for background colorsJune McEnroe 2017-07-30Update helpJune McEnroe 2017-07-30Fix help to track colorJune McEnroe 2017-07-30Support background colorsJune McEnroe 2017-07-30Track color only client-sideJune McEnroe 2017-07-30Add ostensible support for background colorsJune McEnroe 2017-07-30Add tile create and access timestampsJune McEnroe 2017-07-30Assert stable struct Tile field offsetsJune McEnroe 2017-07-30Add chroot.shJune McEnroe 2017-07-30Add ` commandJune McEnroe 2017-07-30Add sshd_configJune McEnroe 2017-07-30Add termcap patchJune McEnroe