aboutsummaryrefslogtreecommitdiff
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
-rw-r--r--cgit.h1
-rw-r--r--shared.c1
-rw-r--r--ui-repolist.c16
3 files changed, 4 insertions, 14 deletions
diff --git a/cgit.h b/cgit.h
index c99d337..ea90833 100644
--- a/cgit.h
+++ b/cgit.h
@@ -61,7 +61,6 @@ struct cgit_repo {
int snapshots;
int enable_log_filecount;
int enable_log_linecount;
- time_t mtime;
};
struct cgit_repolist {
diff --git a/shared.c b/shared.c
index 89d1bab..f5875e4 100644
--- a/shared.c
+++ b/shared.c
@@ -60,7 +60,6 @@ struct cgit_repo *cgit_add_repo(const char *url)
ret->enable_log_linecount = ctx.cfg.enable_log_linecount;
ret->module_link = ctx.cfg.module_link;
ret->readme = NULL;
- ret->mtime = -1;
return ret;
}
diff --git a/ui-repolist.c b/ui-repolist.c
index aa743bf..cf27cb3 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -32,27 +32,19 @@ static int get_repo_modtime(const struct cgit_repo *repo, time_t *mtime)
{
char *path;
struct stat s;
- struct cgit_repo *r = (struct cgit_repo *)repo;
- if (repo->mtime != -1) {
- *mtime = repo->mtime;
- return 1;
- }
path = fmt("%s/%s", repo->path, ctx.cfg.agefile);
if (stat(path, &s) == 0) {
*mtime = read_agefile(path);
- r->mtime = *mtime;
return 1;
}
path = fmt("%s/refs/heads/%s", repo->path, repo->defbranch);
- if (stat(path, &s) == 0)
+ if (stat(path, &s) == 0) {
*mtime = s.st_mtime;
- else
- *mtime = 0;
-
- r->mtime = *mtime;
- return (r->mtime != 0);
+ return 1;
+ }
+ return 0;
}
static void print_modtime(struct cgit_repo *repo)