Skip to content

Commit 934b98f

Browse files
committed
chore: another attempt at fixing GIT_EDITOR
1 parent 3f53fab commit 934b98f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

e2e/helpers_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ func NewTestEnv(t *testing.T) *TestEnv {
5555
env.Git("init")
5656
env.Git("config", "user.email", "test@example.com")
5757
env.Git("config", "user.name", "Test User")
58+
// Prevent git from opening an editor (for commits, rebases, etc.)
59+
// This is set in git config so it applies to all git subprocesses,
60+
// including those spawned by gh-stack commands.
61+
env.Git("config", "core.editor", "cat")
5862

5963
env.WriteFile("README.md", "# Test Repository\n")
6064
env.Git("add", ".")
@@ -92,6 +96,8 @@ func (e *TestEnv) Run(args ...string) *Result {
9296
cmd.Dir = e.WorkDir
9397
cmd.Stdout = &stdout
9498
cmd.Stderr = &stderr
99+
// Ensure git subprocesses spawned by gh-stack don't open an editor
100+
cmd.Env = append(os.Environ(), "GIT_EDITOR=cat")
95101

96102
err := cmd.Run()
97103

0 commit comments

Comments
 (0)