File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments