aboutsummaryrefslogtreecommitdiff
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
-rw-r--r--cgit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cgit.c b/cgit.c
index 8c4517d..20f6e27 100644
--- a/cgit.c
+++ b/cgit.c
@@ -504,6 +504,12 @@ 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;