1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-27 13:39:19 -05:00

Merge pull request '[v7.0/forgejo] services/convert: Convert a Repository's ObjectFormatName too' (#3478) from bp-v7.0/forgejo-2385f3c into v7.0/forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3478
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
This commit is contained in:
Earl Warren 2024-04-26 10:07:58 +00:00
commit 8e304659c5
2 changed files with 12 additions and 0 deletions

View file

@ -232,6 +232,7 @@ func innerToRepo(ctx context.Context, repo *repo_model.Repository, permissionInR
MirrorInterval: mirrorInterval,
MirrorUpdated: mirrorUpdated,
RepoTransfer: transfer,
ObjectFormatName: repo.ObjectFormatName,
}
}

View file

@ -701,3 +701,14 @@ func TestAPIRepoGetAssignees(t *testing.T) {
DecodeJSON(t, resp, &assignees)
assert.Len(t, assignees, 1)
}
func TestAPIViewRepoObjectFormat(t *testing.T) {
defer tests.PrepareTestEnv(t)()
var repo api.Repository
req := NewRequest(t, "GET", "/api/v1/repos/user2/repo1")
resp := MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, resp, &repo)
assert.EqualValues(t, "sha1", repo.ObjectFormatName)
}