From 51de398dd6a20d37f56b68f4a9b240d43405f28e 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 1e3b63bcfb3f39ff32111a4d6e1a906c3144412b..352df3d15f0a9c4b1f3a7877255eb66328ae91a4 100644 --- a/pkg/backend/repo.go +++ b/pkg/backend/repo.go @@ -720,13 +720,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() @@ -735,6 +728,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 }