8000 Fix WorktreeSuite tests by adding required Author field by cappyzawa · Pull Request #1584 · go-git/go-git · GitHub
[go: up one dir, main page]

Skip to content

Fix WorktreeSuite tests by adding required Author field #1584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
8000
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
  • Loading branch information
cappyzawa committed Jun 19, 2025
commit 454332255901ebff75737f29ef9ca28e9934daa5
4 changes: 2 additions & 2 deletions worktree_commit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (s *WorktreeSuite) TestCommitEmptyOptions() {
_, err = w.Add("foo")
s.NoError(err)

hash, err := w.Commit("foo", &CommitOptions{})
hash, err := w.Commit("foo", &CommitOptions{Author: defaultSignature()})
s.NoError(err)
s.False(hash.IsZero())

Expand Down Expand Up @@ -226,7 +226,7 @@ func (s *WorktreeSuite) TestCommitAmendWithChanges() {
_, err = w.Add("bar")
s.NoError(err)

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

headRef, err := w.r.Head()
Expand Down
2 changes: 1 addition & 1 deletion worktree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ func (s *WorktreeSuite) TestCheckoutRelativePathSubmoduleInitialized() {
s.NoError(err)

w.Add(".gitmodules")
w.Commit("test", &CommitOptions{})
w.Commit("test", &CommitOptions{Author: defaultSignature()})

// test submodule path
modules, err := w.readGitmodulesFile()
Expand Down
Loading
0