Skip to content

Commit

Permalink
Add author to test git config
Browse files Browse the repository at this point in the history
  • Loading branch information
jaevans committed Aug 27, 2024
1 parent 3e22011 commit 597e7ff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions cmd/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ import (
func setupRepo() (*git.Repository, error) {
fs := memfs.New()
repo, err := git.Init(memory.NewStorage(), fs)
if err != nil {
return nil, err
}
cfg, err := repo.Config()
if err != nil {
return nil, err
}
cfg.Author.Name = "Test Author"
cfg.Author.Email = "[email protected]"

return repo, err
}
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ go 1.21

require (
github.com/Masterminds/semver v1.5.0
github.com/go-git/go-billy/v5 v5.5.0
github.com/go-git/go-git/v5 v5.12.0
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.18.2
github.com/stretchr/testify v1.9.0
)
Expand All @@ -20,7 +22,6 @@ require (
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
Expand All @@ -38,7 +39,6 @@ require (
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
go.uber.org/atomic v1.9.0 // indirect
Expand Down

0 comments on commit 597e7ff

Please sign in to comment.