Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2021-10-28 14:34:09 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2021-11-01 17:07:55 +0300
commitaa098de7b267e3d6cb8a05e7862a1ad34f8f2ab5 (patch)
tree4d3948e9bba574c51ecca81f24ec00bb0225889e /internal/gitaly/service/diff/raw_test.go
parentf1f158f1cf05ca4af48b957b630655183dc81f16 (diff)
gittest: Convert `ExecStream()` to take a configuration
The `gittest.ExecStream()` helper takes an additional reader which gets used as the spawned command's standard input. In order to make more use of this helper though we'll need to add additional arguments, which would eventually become quite unwieldy to use. Convert the function to instead take the reader via a config struct such that it's more readily extensible.
Diffstat (limited to 'internal/gitaly/service/diff/raw_test.go')
-rw-r--r--internal/gitaly/service/diff/raw_test.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/internal/gitaly/service/diff/raw_test.go b/internal/gitaly/service/diff/raw_test.go
index 5a70e3eae..1a0a56962 100644
--- a/internal/gitaly/service/diff/raw_test.go
+++ b/internal/gitaly/service/diff/raw_test.go
@@ -40,8 +40,8 @@ func TestSuccessfulRawDiffRequest(t *testing.T) {
committerEmail := "scrooge@mcduck.com"
gittest.Exec(t, cfg, "-C", sandboxRepoPath, "reset", "--hard", leftCommit)
- gittest.ExecStream(t, cfg, reader, "-C", sandboxRepoPath, "apply")
- gittest.ExecStream(t, cfg, reader, "-C", sandboxRepoPath, "add", ".")
+ gittest.ExecOpts(t, cfg, gittest.ExecConfig{Stdin: reader}, "-C", sandboxRepoPath, "apply")
+ gittest.Exec(t, cfg, "-C", sandboxRepoPath, "add", ".")
gittest.Exec(t, cfg, "-C", sandboxRepoPath,
"-c", fmt.Sprintf("user.name=%s", committerName),
"-c", fmt.Sprintf("user.email=%s", committerEmail),
@@ -123,8 +123,7 @@ func TestSuccessfulRawPatchRequest(t *testing.T) {
})
gittest.Exec(t, cfg, "-C", sandboxRepoPath, "reset", "--hard", leftCommit)
-
- gittest.ExecStream(t, cfg, reader, "-C", sandboxRepoPath, "am")
+ gittest.ExecOpts(t, cfg, gittest.ExecConfig{Stdin: reader}, "-C", sandboxRepoPath, "am")
expectedTreeStructure := gittest.Exec(t, cfg, "-C", repoPath, "ls-tree", "-r", rightCommit)
actualTreeStructure := gittest.Exec(t, cfg, "-C", sandboxRepoPath, "ls-tree", "-r", "HEAD")