diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-05-07 15:23:08 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-05-07 16:02:04 +1000 |
commit | cd5b041b0f8b95b473849d222b71aa2fe3b24899 (patch) | |
tree | 87b6610fa4fcbee10390966d47d1adac5e60618f /pkg/commands/git_commands | |
parent | cf80978f15a60f8edd64990e24224a8f69707869 (diff) |
clearer separation of concerns when bootstrapping application
Diffstat (limited to 'pkg/commands/git_commands')
-rw-r--r-- | pkg/commands/git_commands/rebase.go | 7 | ||||
-rw-r--r-- | pkg/commands/git_commands/rebase_test.go | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/pkg/commands/git_commands/rebase.go b/pkg/commands/git_commands/rebase.go index ab7963c44..e69c8b1bd 100644 --- a/pkg/commands/git_commands/rebase.go +++ b/pkg/commands/git_commands/rebase.go @@ -8,6 +8,7 @@ import ( "github.com/go-errors/errors" "github.com/jesseduffield/generics/slices" + "github.com/jesseduffield/lazygit/pkg/app/daemon" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" ) @@ -109,8 +110,8 @@ func (self *RebaseCommands) PrepareInteractiveRebaseCommand(baseSha string, todo } cmdObj.AddEnvVars( - "LAZYGIT_CLIENT_COMMAND=INTERACTIVE_REBASE", - "LAZYGIT_REBASE_TODO="+todo, + daemon.DaemonKindEnvKey+"="+string(daemon.InteractiveRebase), + daemon.RebaseTODOEnvKey+"="+todo, "DEBUG="+debug, "LANG=en_US.UTF-8", // Force using EN as language "LC_ALL=en_US.UTF-8", // Force using EN as language @@ -297,7 +298,7 @@ func (self *RebaseCommands) runSkipEditorCommand(cmdObj oscommands.ICmdObj) erro lazyGitPath := oscommands.GetLazygitPath() return cmdObj. AddEnvVars( - "LAZYGIT_CLIENT_COMMAND=EXIT_IMMEDIATELY", + daemon.DaemonKindEnvKey+"="+string(daemon.ExitImmediately), "GIT_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 4e7b5c2c6..c4d18000f 100644 --- a/pkg/commands/git_commands/rebase_test.go +++ b/pkg/commands/git_commands/rebase_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/go-errors/errors" + "github.com/jesseduffield/lazygit/pkg/app/daemon" "github.com/jesseduffield/lazygit/pkg/commands/git_config" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" @@ -61,7 +62,7 @@ func TestRebaseSkipEditorCommand(t *testing.T) { `^VISUAL=.*$`, `^EDITOR=.*$`, `^GIT_EDITOR=.*$`, - "^LAZYGIT_CLIENT_COMMAND=EXIT_IMMEDIATELY$", + "^" + daemon.DaemonKindEnvKey + "=" + string(daemon.ExitImmediately) + "$", } { regexStr := regexStr foundMatch := lo.ContainsBy(envVars, func(envVar string) bool { |