[PATCH] guess default branch from HEAD

chris jugg at hotmail.com
Tue Jul 19 11:35:42 CEST 2011


> <larsh at ...> 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.

It is a little strange to have the idle time not use the default branch.
Should guess_defbranch() be called here instead of hard-coding "master"?

chris






More information about the CGit mailing list