Revert "fix tests/integration/recipe_new.bats"
All checks were successful
continuous-integration/drone/pr Build is passing

This reverts commit 0aac464ded.
This commit is contained in:
2024-03-07 17:48:42 +01:00
parent a760280564
commit a44549117d
4 changed files with 9 additions and 31 deletions

View File

@ -2,13 +2,13 @@ package git
import (
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing/object"
gitPkg "github.com/go-git/go-git/v5"
"github.com/sirupsen/logrus"
)
// Init inits a new repo and commits all the stuff if you want
func Init(repoPath string, commit bool, gitUser, gitEmail string) error {
if _, err := git.PlainInit(repoPath, false); err != nil {
func Init(repoPath string, commit bool) error {
if _, err := gitPkg.PlainInit(repoPath, false); err != nil {
logrus.Fatal(err)
}
logrus.Debugf("initialised new git repo in %s", repoPath)
@ -28,12 +28,7 @@ func Init(repoPath string, commit bool, gitUser, gitEmail string) error {
return err
}
var author *object.Signature
if gitUser != "" && gitEmail != "" {
author = &object.Signature{Name: gitUser, Email: gitEmail}
}
if _, err = commitWorktree.Commit("init", &git.CommitOptions{Author: author}); err != nil {
if _, err = commitWorktree.Commit("init", &git.CommitOptions{}); err != nil {
return err
}
logrus.Debugf("init committed all files for new git repo in %s", repoPath)