mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 21:05:48 +02:00
Add 'w' keybinding in files panel to commit as a WIP
If your git.skipHookPrefix is set to, say, WIP, in your config, then hitting 'w' in the files panel will bring up the commit message panel with 'WIP' pre-filled, so you just need to hit enter to confirm (or add some more to the message) in order to commit your changes with the --no-verify flag, meaning the pre-commit hook will be skipped
This commit is contained in:
parent
ab9fa291a8
commit
0d3a193ab5
5 changed files with 54 additions and 4 deletions
|
@ -801,6 +801,7 @@ func TestGitCommandCommit(t *testing.T) {
|
|||
command func(string, ...string) *exec.Cmd
|
||||
getGlobalGitConfig func(string) (string, error)
|
||||
test func(*exec.Cmd, error)
|
||||
flags string
|
||||
}
|
||||
|
||||
scenarios := []scenario{
|
||||
|
@ -808,7 +809,7 @@ func TestGitCommandCommit(t *testing.T) {
|
|||
"Commit using gpg",
|
||||
func(cmd string, args ...string) *exec.Cmd {
|
||||
assert.EqualValues(t, "bash", cmd)
|
||||
assert.EqualValues(t, []string{"-c", `git commit -m 'test'`}, args)
|
||||
assert.EqualValues(t, []string{"-c", `git commit -m 'test'`}, args)
|
||||
|
||||
return exec.Command("echo")
|
||||
},
|
||||
|
@ -819,6 +820,7 @@ func TestGitCommandCommit(t *testing.T) {
|
|||
assert.NotNil(t, cmd)
|
||||
assert.Nil(t, err)
|
||||
},
|
||||
"",
|
||||
},
|
||||
{
|
||||
"Commit without using gpg",
|
||||
|
@ -835,6 +837,24 @@ func TestGitCommandCommit(t *testing.T) {
|
|||
assert.Nil(t, cmd)
|
||||
assert.Nil(t, err)
|
||||
},
|
||||
"",
|
||||
},
|
||||
{
|
||||
"Commit with --no-verify flag",
|
||||
func(cmd string, args ...string) *exec.Cmd {
|
||||
assert.EqualValues(t, "git", cmd)
|
||||
assert.EqualValues(t, []string{"commit", "--no-verify", "-m", "test"}, args)
|
||||
|
||||
return exec.Command("echo")
|
||||
},
|
||||
func(string) (string, error) {
|
||||
return "false", nil
|
||||
},
|
||||
func(cmd *exec.Cmd, err error) {
|
||||
assert.Nil(t, cmd)
|
||||
assert.Nil(t, err)
|
||||
},
|
||||
"--no-verify",
|
||||
},
|
||||
{
|
||||
"Commit without using gpg with an error",
|
||||
|
@ -851,6 +871,7 @@ func TestGitCommandCommit(t *testing.T) {
|
|||
assert.Nil(t, cmd)
|
||||
assert.Error(t, err)
|
||||
},
|
||||
"",
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -859,7 +880,7 @@ func TestGitCommandCommit(t *testing.T) {
|
|||
gitCmd := NewDummyGitCommand()
|
||||
gitCmd.getGlobalGitConfig = s.getGlobalGitConfig
|
||||
gitCmd.OSCommand.command = s.command
|
||||
s.test(gitCmd.Commit("test"))
|
||||
s.test(gitCmd.Commit("test", s.flags))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue