all repos — cgit @ 9dd67272ed57e8923510197eb5ac8d3f819fbb26

a hyperfast web frontend for git written in c

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>
Lukas Fleischer cgit@cryptocrack.de
Sun, 27 Jul 2014 20:50:59 +0200
commit

9dd67272ed57e8923510197eb5ac8d3f819fbb26

parent

efa2879ad760f6f12c1aa9d2bb9918f0afe9f084

1 files changed, 0 insertions(+), 6 deletions(-)

jump to
M cgit.ccgit.c

@@ -504,12 +504,6 @@ free(filename);

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;