ui-repolist.c: fallback to "master" if no default branch is specified

When looking for the modtime of a repo we used to rely on repo.defbranch
having a value. This is no longer true so this patch provides a default
value when needed.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
upstream
Lars Hjemli 14 years ago
parent 8d7c2ec295
commit 5293c8b799
  1. 3
      ui-repolist.c

@ -45,7 +45,8 @@ static int get_repo_modtime(const struct cgit_repo *repo, time_t *mtime)
return 1;
}
path = fmt("%s/refs/heads/%s", repo->path, repo->defbranch);
path = fmt("%s/refs/heads/%s", repo->path, repo->defbranch ?
repo->defbranch : "master");
if (stat(path, &s) == 0) {
*mtime = s.st_mtime;
r->mtime = *mtime;

Loading…
Cancel
Save