summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorPaul Horn <dev@knutwalker.engineer>2023-01-01 04:33:58 +0100
committerPaul Horn <dev@knutwalker.engineer>2023-01-01 04:37:19 +0100
commitbc7873144ee445da194d50e755cd4597bc176556 (patch)
treef48b6ca76a22f32074825ffaa72c450d46edcd19 /pkg/commands
parent1bb138c79c466e6207ae450a1bbd937c2713e449 (diff)
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.
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/git_commands/rebase.go1
-rw-r--r--pkg/commands/git_commands/rebase_test.go1
2 files changed, 2 insertions, 0 deletions
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