author | Lars Hjemli <hjemli@gmail.com> | 2010-08-21 13:08:01 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2010-08-22 11:35:47 (UTC) |
commit | 515edb0da3b9156e07e269621d7474cdea82acaf (patch) (side-by-side diff) | |
tree | e5fed5e83f29166c23216437386e10070e1d258d /scan-tree.c | |
parent | 6d7552bc072599313ef423d69156d824c075572a (diff) | |
download | cgit-515edb0da3b9156e07e269621d7474cdea82acaf.zip cgit-515edb0da3b9156e07e269621d7474cdea82acaf.tar.gz cgit-515edb0da3b9156e07e269621d7474cdea82acaf.tar.bz2 |
Add support for "readme" option
The value of this option is used as the default value for repo.readme.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | scan-tree.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scan-tree.c b/scan-tree.c index e987824..780d405 100644 --- a/scan-tree.c +++ b/scan-tree.c @@ -107,15 +107,17 @@ static void add_repo(const char *base, const char *path, repo_config_fn fn) repo->owner = owner; p = fmt("%s/description", path); if (!stat(p, &st)) readfile(p, &repo->desc, &size); - p = fmt("%s/README.html", path); - if (!stat(p, &st)) - repo->readme = "README.html"; + if (!repo->readme) { + p = fmt("%s/README.html", path); + if (!stat(p, &st)) + repo->readme = "README.html"; + } p = fmt("%s/cgitrc", path); if (!stat(p, &st)) { config_fn = fn; parse_configfile(xstrdup(p), &repo_config); } |