diff options
author | Lukas Fleischer | 2014-07-27 20:50:59 +0200 |
---|---|---|
committer | Jason A. Donenfeld | 2014-08-07 14:38:02 +0200 |
commit | 9dd67272ed57e8923510197eb5ac8d3f819fbb26 (patch) | |
tree | 395d89b92be73223a430e7dff2c352fed05e51ab /cgit.c | |
parent | efa2879ad760f6f12c1aa9d2bb9918f0afe9f084 (diff) | |
download | cgit-9dd67272ed57e8923510197eb5ac8d3f819fbb26.tar.gz cgit-9dd67272ed57e8923510197eb5ac8d3f819fbb26.tar.bz2 cgit-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.c | 6 |
1 files changed, 0 insertions, 6 deletions
@@ -504,12 +504,6 @@ static void choose_readme(struct cgit_repo *repo) | |||
504 | free(ref); | 504 | free(ref); |
505 | continue; | 505 | continue; |
506 | } | 506 | } |
507 | /* If there's only one item, we skip the possibly expensive | ||
508 | * selection process. */ | ||
509 | if (repo->readme.nr == 1) { | ||
510 | found = 1; | ||
511 | break; | ||
512 | } | ||
513 | if (ref) { | 507 | if (ref) { |
514 | if (cgit_ref_path_exists(filename, ref, 1)) { | 508 | if (cgit_ref_path_exists(filename, ref, 1)) { |
515 | found = 1; | 509 | found = 1; |