From mboxrd@z Thu Jan 1 00:00:00 1970 From: larsh at hjemli.net (larsh at hjemli.net) Date: Tue, 19 Jul 2011 09:56:07 +0000 Subject: [PATCH] guess default branch from HEAD In-Reply-To: References: <20110407104958.GB1004@plenz.com> <1302173964-12520-1-git-send-email-plenz@cis.fu-berlin.de> <20110613101621.GA29265@hjemli.net> <20110616145921.GA5875@plenz.com> <20110719063058.GA7524@hjemli.net> Message-ID: <20110719095607.GC16136@hjemli.net> On Tue, Jul 19, 2011 at 09:35:42AM +0000, chris wrote: > > writes: > > On Sat, Jul 09, 2011 at 08:09:57AM +0000, chris wrote: > > > the index page 'idle' times no longer show up (the idle column is blank). > > > > Thanks for noticing. I think the following patch will fix the issue: > > > > diff --git a/ui-repolist.c b/ui-repolist.c > > index 25c36ce..f21d28d 100644 > > --- a/ui-repolist.c > > +++ b/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; > > > > -- > > larsh > > This patch corrected the problem of the idle times being empty on the index > page. Thanks for testing. > > It is a little strange to have the idle time not use the default branch. Well, "master" is the defacto default branch... > Should guess_defbranch() be called here instead of hard-coding "master"? I don't think so, due to performance concerns (as explained earlier in this thread). It's a compromise, favoring performance over correctness. -- larsh