From bc7873144ee445da194d50e755cd4597bc176556 Mon Sep 17 00:00:00 2001 From: Paul Horn Date: Sun, 1 Jan 2023 04:33:58 +0100 Subject: [PATCH] Override GIT_SEQUENCE_EDITOR for rebase commands I noticed that `$GIT_SEQUENCE_EDITOR` is overridden in `PrepareInteractiveRebaseCommand` but not in `runSkipEditorCommand`. Before this change, some commands such as `SquashAllAboveFixupCommits` would not work when a different sequence editor, e.g. [git-interactive-rebase-tool](https://github.com/MitMaro/git-interactive-rebase-tool) is configured. --- pkg/commands/git_commands/rebase.go | 1 + pkg/commands/git_commands/rebase_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/pkg/commands/git_commands/rebase.go b/pkg/commands/git_commands/rebase.go index 11c187f36..9ab13da3e 100644 --- a/pkg/commands/git_commands/rebase.go +++ b/pkg/commands/git_commands/rebase.go @@ -332,6 +332,7 @@ func (self *RebaseCommands) runSkipEditorCommand(cmdObj oscommands.ICmdObj) erro AddEnvVars( daemon.DaemonKindEnvKey+"="+string(daemon.ExitImmediately), "GIT_EDITOR="+lazyGitPath, + "GIT_SEQUENCE_EDITOR="+lazyGitPath, "EDITOR="+lazyGitPath, "VISUAL="+lazyGitPath, ). diff --git a/pkg/commands/git_commands/rebase_test.go b/pkg/commands/git_commands/rebase_test.go index c4d18000f..1c28c82b0 100644 --- a/pkg/commands/git_commands/rebase_test.go +++ b/pkg/commands/git_commands/rebase_test.go @@ -62,6 +62,7 @@ func TestRebaseSkipEditorCommand(t *testing.T) { `^VISUAL=.*$`, `^EDITOR=.*$`, `^GIT_EDITOR=.*$`, + `^GIT_SEQUENCE_EDITOR=.*$`, "^" + daemon.DaemonKindEnvKey + "=" + string(daemon.ExitImmediately) + "$", } { regexStr := regexStr