mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-15 00:15:32 +02:00
use GIT_EDITOR
This commit is contained in:
@ -648,6 +648,7 @@ func (c *GitCommand) RunSkipEditorCommand(command string) error {
|
|||||||
cmd.Env = append(
|
cmd.Env = append(
|
||||||
cmd.Env,
|
cmd.Env,
|
||||||
"LAZYGIT_CLIENT_COMMAND=EXIT_IMMEDIATELY",
|
"LAZYGIT_CLIENT_COMMAND=EXIT_IMMEDIATELY",
|
||||||
|
"GIT_EDITOR="+lazyGitPath,
|
||||||
"EDITOR="+lazyGitPath,
|
"EDITOR="+lazyGitPath,
|
||||||
"VISUAL="+lazyGitPath,
|
"VISUAL="+lazyGitPath,
|
||||||
)
|
)
|
||||||
@ -758,7 +759,7 @@ func (c *GitCommand) PrepareInteractiveRebaseCommand(baseSha string, todo string
|
|||||||
)
|
)
|
||||||
|
|
||||||
if overrideEditor {
|
if overrideEditor {
|
||||||
cmd.Env = append(cmd.Env, "EDITOR="+ex)
|
cmd.Env = append(cmd.Env, "GIT_EDITOR="+ex)
|
||||||
}
|
}
|
||||||
|
|
||||||
return cmd, nil
|
return cmd, nil
|
||||||
|
@ -2147,6 +2147,13 @@ func TestGitCommandSkipEditorCommand(t *testing.T) {
|
|||||||
"expected EDITOR to be set for a non-interactive external command",
|
"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(
|
test.AssertContainsMatch(
|
||||||
t,
|
t,
|
||||||
cmd.Env,
|
cmd.Env,
|
||||||
|
Reference in New Issue
Block a user