From f0663b3c138ab10e180d0b8f0b7f321f455778f1 Mon Sep 17 00:00:00 2001 From: petergardfjall Date: Mon, 28 Mar 2022 19:06:48 +0800 Subject: [PATCH] add mirror_updated field to Repository struct (#565) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR resolves https://gitea.com/gitea/go-sdk/issues/566. It ensures that the client-side SDK extracts the `mirror_updated` field introduced on the server by https://github.com/go-gitea/gitea/pull/18267 (issue: https://github.com/go-gitea/gitea/issues/18266). Co-authored-by: Peter GardfjÀll Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/565 Reviewed-by: Andrew Thornton Reviewed-by: Norwin Co-authored-by: petergardfjall Co-committed-by: petergardfjall --- gitea/repo.go | 1 + gitea/repo_test.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/gitea/repo.go b/gitea/repo.go index 9fa0545..7ccde53 100644 --- a/gitea/repo.go +++ b/gitea/repo.go @@ -93,6 +93,7 @@ type Repository struct { AvatarURL string `json:"avatar_url"` Internal bool `json:"internal"` MirrorInterval string `json:"mirror_interval"` + MirrorUpdated time.Time `json:"mirror_updated,omitempty"` DefaultMergeStyle MergeStyle `json:"default_merge_style"` } diff --git a/gitea/repo_test.go b/gitea/repo_test.go index ee9c396..a7e572b 100644 --- a/gitea/repo_test.go +++ b/gitea/repo_test.go @@ -61,6 +61,8 @@ func TestRepoMigrateAndLanguages(t *testing.T) { assert.True(t, repoG.Mirror) assert.False(t, repoG.Empty) assert.EqualValues(t, 1, repoG.Watchers) + var zeroTime time.Time + assert.NotEqual(t, zeroTime, repoG.MirrorUpdated) log.Println("== TestRepoLanguages ==") time.Sleep(time.Second)