Adjust object format interface (#28469)
- Remove `ObjectFormatID` - Remove function `ObjectFormatFromID`. - Use `Sha1ObjectFormat` directly but not a pointer because it's an empty struct. - Store `ObjectFormatName` in `repository` struct
This commit is contained in:
parent
7fb6b51470
commit
408a484224
54 changed files with 191 additions and 203 deletions
|
@ -19,12 +19,12 @@ import (
|
|||
func TestToCommitMeta(t *testing.T) {
|
||||
assert.NoError(t, unittest.PrepareTestDatabase())
|
||||
headRepo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
|
||||
sha1 := git.ObjectFormatFromID(git.Sha1)
|
||||
sha1 := git.Sha1ObjectFormat
|
||||
signature := &git.Signature{Name: "Test Signature", Email: "test@email.com", When: time.Unix(0, 0)}
|
||||
tag := &git.Tag{
|
||||
Name: "Test Tag",
|
||||
ID: sha1.Empty(),
|
||||
Object: sha1.Empty(),
|
||||
ID: sha1.EmptyObjectID(),
|
||||
Object: sha1.EmptyObjectID(),
|
||||
Type: "Test Type",
|
||||
Tagger: signature,
|
||||
Message: "Test Message",
|
||||
|
@ -34,8 +34,8 @@ func TestToCommitMeta(t *testing.T) {
|
|||
|
||||
assert.NotNil(t, commitMeta)
|
||||
assert.EqualValues(t, &api.CommitMeta{
|
||||
SHA: sha1.Empty().String(),
|
||||
URL: util.URLJoin(headRepo.APIURL(), "git/commits", sha1.Empty().String()),
|
||||
SHA: sha1.EmptyObjectID().String(),
|
||||
URL: util.URLJoin(headRepo.APIURL(), "git/commits", sha1.EmptyObjectID().String()),
|
||||
Created: time.Unix(0, 0),
|
||||
}, commitMeta)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue