mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-23 00:39:13 +02:00
Add coauthor (#2)
Add co-author to commits Add addCoAuthor command for commits - Implement the `addCoAuthor` command to add co-authors to commits. - Utilize suggestions helpers to populate author names from the suggestions list. - Added command to gui at `LocalCommitsController`. This commit introduces the `addCoAuthor` command, which allows users to easily add co-authors to their commits. The co-author names are populated from the suggestions list, minimizing the chances of user input errors. The co-authors are added using the Co-authored-by metadata format recognized by GitHub and GitLab.
This commit is contained in:
40
pkg/integration/tests/commit/add_co_author.go
Normal file
40
pkg/integration/tests/commit/add_co_author.go
Normal file
@ -0,0 +1,40 @@
|
||||
package commit
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var AddCoAuthor = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Add co-author on a commit",
|
||||
ExtraCmdArgs: []string{},
|
||||
Skip: false,
|
||||
SetupConfig: func(config *config.AppConfig) {},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shell.EmptyCommit("initial commit")
|
||||
},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
t.Views().Commits().
|
||||
Focus().
|
||||
Lines(
|
||||
Contains("initial commit").IsSelected(),
|
||||
).
|
||||
Press(keys.Commits.ResetCommitAuthor).
|
||||
Tap(func() {
|
||||
t.ExpectPopup().Menu().
|
||||
Title(Equals("Amend commit attribute")).
|
||||
Select(Contains("Add co-author")).
|
||||
Confirm()
|
||||
|
||||
t.ExpectPopup().Prompt().
|
||||
Title(Contains("Add co-author")).
|
||||
Type("John Smith <jsmith@gmail.com>").
|
||||
Confirm()
|
||||
})
|
||||
|
||||
t.Views().Main().ContainsLines(
|
||||
Contains("initial commit"),
|
||||
Contains("Co-authored-by: John Smith <jsmith@gmail.com>"),
|
||||
)
|
||||
},
|
||||
})
|
Reference in New Issue
Block a user