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:
authorPavlo Strokov <pstrokov@gitlab.com>2021-04-27 20:23:32 +0300
committerPavlo Strokov <pstrokov@gitlab.com>2021-04-29 22:13:52 +0300
commitd266053b3f0cc26c82cea5626c2da8d495485d83 (patch)
treec59423cf46c8387fffe2186a740a15669f640d67
parent8844896103d7456f0a260259e4e5b7d9e42afb38 (diff)
Replace MustRunCommand with Exec in repository_suite.go
Usages of the MustRunCommand replaced with Exec in order to break dependency on the global config.Config variable. The change includes only the calls that don't require change of the function signatures. Part of: https://gitlab.com/gitlab-org/gitaly/-/issues/2699
-rw-r--r--internal/git/gittest/repository_suite.go12
1 files changed, 3 insertions, 9 deletions
diff --git a/internal/git/gittest/repository_suite.go b/internal/git/gittest/repository_suite.go
index 3c6bb0f8f..35c6a9c0d 100644
--- a/internal/git/gittest/repository_suite.go
+++ b/internal/git/gittest/repository_suite.go
@@ -94,21 +94,15 @@ func testRepositoryHasBranches(t *testing.T, cfg config.Cfg, getRepository func(
repo := getRepository(t, pbRepo)
- emptyCommit := text.ChompBytes(testhelper.MustRunCommand(t, nil,
- "git", "-C", repoPath, "commit-tree", git.EmptyTreeOID.String(),
- ))
+ emptyCommit := text.ChompBytes(Exec(t, cfg, "-C", repoPath, "commit-tree", git.EmptyTreeOID.String()))
- testhelper.MustRunCommand(t, nil,
- "git", "-C", repoPath, "update-ref", "refs/headsbranch", emptyCommit,
- )
+ Exec(t, cfg, "-C", repoPath, "update-ref", "refs/headsbranch", emptyCommit)
hasBranches, err := repo.HasBranches(ctx)
require.NoError(t, err)
require.False(t, hasBranches)
- testhelper.MustRunCommand(t, nil,
- "git", "-C", repoPath, "update-ref", "refs/heads/branch", emptyCommit,
- )
+ Exec(t, cfg, "-C", repoPath, "update-ref", "refs/heads/branch", emptyCommit)
hasBranches, err = repo.HasBranches(ctx)
require.NoError(t, err)