diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-12-17 19:56:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-17 11:56:08 +0000 |
commit | 408a4842240e7dd906e682196bd4254d6c76fcb9 (patch) | |
tree | ec3962d5769a5891a24b4d79f725673fc1e46e35 /tests | |
parent | 7fb6b5147038649bfaa26147a6173cf99b322a30 (diff) | |
download | gitea-408a4842240e7dd906e682196bd4254d6c76fcb9.tar.gz gitea-408a4842240e7dd906e682196bd4254d6c76fcb9.zip |
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
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/git_helper_for_declarative_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/integration/git_helper_for_declarative_test.go b/tests/integration/git_helper_for_declarative_test.go index de671dec19..77fe07128e 100644 --- a/tests/integration/git_helper_for_declarative_test.go +++ b/tests/integration/git_helper_for_declarative_test.go @@ -120,7 +120,7 @@ func doGitCloneFail(u *url.URL) func(*testing.T) { func doGitInitTestRepository(dstPath string) func(*testing.T) { return func(t *testing.T) { // Init repository in dstPath - assert.NoError(t, git.InitRepository(git.DefaultContext, dstPath, false, git.ObjectFormatFromID(git.Sha1))) + assert.NoError(t, git.InitRepository(git.DefaultContext, dstPath, false, git.Sha1ObjectFormat.Name())) // forcibly set default branch to master _, _, err := git.NewCommand(git.DefaultContext, "symbolic-ref", "HEAD", git.BranchPrefix+"master").RunStdString(&git.RunOpts{Dir: dstPath}) assert.NoError(t, err) |