Fast implementation of Git in pure Go codeberg.org/lindenii/furgit
git go
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

testgit: Remove old new-repo helpers and use NewRepo with good RepoOptions

Runxi Yu 304559e6 680d30bd

+4 -13
+4 -13
internal/testgit/repo_new.go
··· 9 9 10 10 // RepoOptions controls git-init options for test repositories. 11 11 type RepoOptions struct { 12 + // ObjectFormat is the object ID algorithm used for repository objects. 13 + ObjectFormat objectid.Algorithm 12 14 // Bare selects whether the repository is initialized as bare. 13 15 Bare bool 14 16 // RefFormat selects the git ref storage format (for example "files" or ··· 16 18 RefFormat string 17 19 } 18 20 19 - // NewBareRepo creates a temporary bare repository initialized with the requested algorithm. 20 - func NewBareRepo(tb testing.TB, algo objectid.Algorithm) *TestRepo { 21 - tb.Helper() 22 - return NewRepo(tb, algo, RepoOptions{Bare: true}) 23 - } 24 - 25 - // NewWorkRepo creates a temporary non-bare repository initialized with the requested algorithm. 26 - func NewWorkRepo(tb testing.TB, algo objectid.Algorithm) *TestRepo { 27 - tb.Helper() 28 - return NewRepo(tb, algo, RepoOptions{Bare: false}) 29 - } 30 - 31 21 // NewRepo creates a temporary repository initialized with the requested options. 32 - func NewRepo(tb testing.TB, algo objectid.Algorithm, opts RepoOptions) *TestRepo { 22 + func NewRepo(tb testing.TB, opts RepoOptions) *TestRepo { 33 23 tb.Helper() 24 + algo := opts.ObjectFormat 34 25 if algo.Size() == 0 { 35 26 tb.Fatalf("invalid algorithm: %v", algo) 36 27 }