1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-24 05:36:19 +02:00

use GIT_EDITOR

This commit is contained in:
Jesse Duffield 2020-03-27 09:16:41 +11:00
parent 2d8ed5e274
commit d1395b15bb
2 changed files with 9 additions and 1 deletions

View File

@ -648,6 +648,7 @@ func (c *GitCommand) RunSkipEditorCommand(command string) error {
cmd.Env = append(
cmd.Env,
"LAZYGIT_CLIENT_COMMAND=EXIT_IMMEDIATELY",
"GIT_EDITOR="+lazyGitPath,
"EDITOR="+lazyGitPath,
"VISUAL="+lazyGitPath,
)
@ -758,7 +759,7 @@ func (c *GitCommand) PrepareInteractiveRebaseCommand(baseSha string, todo string
)
if overrideEditor {
cmd.Env = append(cmd.Env, "EDITOR="+ex)
cmd.Env = append(cmd.Env, "GIT_EDITOR="+ex)
}
return cmd, nil

View File

@ -2147,6 +2147,13 @@ func TestGitCommandSkipEditorCommand(t *testing.T) {
"expected EDITOR to be set for a non-interactive external command",
)
test.AssertContainsMatch(
t,
cmd.Env,
regexp.MustCompile("^GIT_EDITOR="),
"expected GIT_EDITOR to be set for a non-interactive external command",
)
test.AssertContainsMatch(
t,
cmd.Env,