From f2c609e8e38de75d084299d9fc0e5c534ba3362e Mon Sep 17 00:00:00 2001 From: Amolith Date: Wed, 8 Oct 2025 22:23:19 -0600 Subject: [PATCH] feat: prioritize latest commit time for repo UpdatedAt Change the order of operations in UpdatedAt() to first try getting the timestamp from the latest commit before falling back to the last-modified file. This ensures more accurate update timestamps. Co-Authored-By: Crush --- pkg/backend/repo.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pkg/backend/repo.go b/pkg/backend/repo.go index bacc8993848b638d4090b79e9f50a348446aa99a..0470c1f990ca3acd21f57e3568b2660c5da74ee2 100644 --- a/pkg/backend/repo.go +++ b/pkg/backend/repo.go @@ -718,13 +718,6 @@ func (r *repo) CreatedAt() time.Time { // UpdatedAt returns the repository's last update time. func (r *repo) UpdatedAt() time.Time { - // Try to read the last modified time from the info directory. - if t, err := readOneline(filepath.Join(r.path, "info", "last-modified")); err == nil { - if t, err := time.Parse(time.RFC3339, t); err == nil { - return t - } - } - rr, err := git.Open(r.path) if err == nil { t, err := rr.LatestCommitTime() @@ -733,6 +726,12 @@ func (r *repo) UpdatedAt() time.Time { } } + if t, err := readOneline(filepath.Join(r.path, "info", "last-modified")); err == nil { + if t, err := time.Parse(time.RFC3339, t); err == nil { + return t + } + } + return r.repo.UpdatedAt }