8000 git: worktree, Add required Author field to fix failing tests · go-git/go-git@4543322 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4543322

Browse files
committed
git: worktree, Add required Author field to fix failing tests
Tests were failing due to v6 branch requirement for Author field in CommitOptions. Added defaultSignature() as Author to: - TestCommitEmptyOptions - TestCommitAmendWithChanges - TestCheckoutRelativePathSubmoduleInitialized Signed-off-by: cappyzawa <cappyzawa@gmail.com>
1 parent 5458d22 commit 4543322

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

worktree_commit_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (s *WorktreeSuite) TestCommitEmptyOptions() {
4242
_, err = w.Add("foo")
4343
s.NoError(err)
4444

45-
hash, err := w.Commit("foo", &CommitOptions{})
45+
hash, err := w.Commit("foo", &CommitOptions{Author: defaultSignature()})
4646
s.NoError(err)
4747
s.False(hash.IsZero())
4848

@@ -226,7 +226,7 @@ func (s *WorktreeSuite) TestCommitAmendWithChanges() {
226226
_, err = w.Add("bar")
227227
s.NoError(err)
228228

229-
amendedHash, err := w.Commit("bar\n", &CommitOptions{Amend: true})
229+
amendedHash, err := w.Commit("bar\n", &CommitOptions{Author: defaultSignature(), Amend: true})
230230
s.NoError(err)
231231

232232
headRef, err := w.r.Head()

worktree_test.go

+1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ func (s *WorktreeSuite) TestCheckoutRelativePathSubmoduleInitialized() {
623623
s.NoError(err)
624624

625625
w.Add(".gitmodules")
626-
w.Commit("test", &CommitOptions{})
626+
w.Commit("test", &CommitOptions{Author: defaultSignature()})
627627

628628
// test submodule path
629629
modules, err := w.readGitmodulesFile()

0 commit comments

Comments
 (0)
0