Skip to content

Commit 486e8ca

Browse files
committed
cmd/gg: propagate PATH to the editor and gg in tests
1 parent 4c319a5 commit 486e8ca

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ The format is based on [Keep a Changelog][], and this project adheres to
66
[Keep a Changelog]: https://keepachangelog.com/en/1.0.0/
77
[Unreleased]: https://github.com/gg-scm/gg/compare/v1.2.0...HEAD
88

9+
## [Unreleased][]
10+
11+
### Fixed
12+
13+
- The test suite now propagates `PATH` to the editor and gg.
14+
This fixes the check phase in Nix packaging.
15+
916
## [1.2.0][] - 2022-02-24
1017

1118
Version 1.2 includes features to handle repositories with lots of branches.

cmd/gg/editor_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"bytes"
1919
"context"
2020
"fmt"
21+
"os"
2122
"path/filepath"
2223
"runtime"
2324
"strings"
@@ -54,6 +55,7 @@ func TestEditor(t *testing.T) {
5455
log: func(e error) {
5556
t.Error("Editor error:", e)
5657
},
58+
env: os.Environ(),
5759
stderr: stderr,
5860
}
5961
got, err := e.open(ctx, "foo.txt", []byte("This is the initial content.\n"))
@@ -100,6 +102,7 @@ func TestEditorDirectory(t *testing.T) {
100102
log: func(e error) {
101103
t.Error("Editor error:", e)
102104
},
105+
env: os.Environ(),
103106
stderr: stderr,
104107
}
105108
got, err := e.open(ctx, "foo.txt", []byte("This is the initial content.\n"))

cmd/gg/main_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ func (env *testEnv) gg(ctx context.Context, dir string, args ...string) ([]byte,
261261
env: []string{
262262
"GIT_CONFIG_NOSYSTEM=1",
263263
"HOME=" + env.topDir.String(),
264+
"PATH=" + os.Getenv("PATH"),
264265
"XDG_CONFIG_HOME=" + xdgConfigDir,
265266
"XDG_CONFIG_DIRS=" + xdgConfigDir,
266267
},

0 commit comments

Comments
 (0)