feat: add git pull to update cached repositories from remote
Deploy PR-Helper / deploy (push) Successful in 34s

- Replace dead FetchRemote with PullRepo (fetch + merge) in services/git.go
- Add POST /api/repos/:id/pull endpoint with DB size/last_used update
- Add '更新' button next to each cached repo in the index page
This commit is contained in:
2026-06-21 14:31:33 +08:00
parent 25291a81a3
commit 20be99b287
4 changed files with 85 additions and 11 deletions
+1
View File
@@ -114,6 +114,7 @@ func main() {
r.POST("/api/repos", authMw, repos.CloneRepo)
r.DELETE("/api/repos/:id", authMw, repos.DeleteRepo)
r.POST("/api/repos/:id/cleanup", authMw, repos.CleanupRepos)
r.POST("/api/repos/:id/pull", authMw, repos.PullRepo)
r.GET("/api/repos/:id/graph", authMw, repos.GetGraph)
r.GET("/api/repos/:id/refs", authMw, repos.GetRefs)
r.GET("/api/repos/:id/commits", authMw, repos.GetCommits)