diff options
author | Pavlo Strokov <pstrokov@gitlab.com> | 2021-04-30 09:37:30 +0300 |
---|---|---|
committer | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-05-11 13:51:41 +0300 |
commit | 9f4e1f58728c6b536214d12bae67ba3e6fe0432d (patch) | |
tree | a8dcdccf1cc633d4748f0c5d442ceaa4361750ec | |
parent | 9b214dd2db39f8a56f005a225f66607bc082c8f7 (diff) |
Replace MustRunCommand with gittest.Exec in git
The replacement is done to break dependency on the global
config.Config variable.
Part of: https://gitlab.com/gitlab-org/gitaly/-/issues/2699
-rw-r--r-- | internal/git/command_factory_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/git/command_factory_test.go b/internal/git/command_factory_test.go index dbcffbf5f..fe958cd71 100644 --- a/internal/git/command_factory_test.go +++ b/internal/git/command_factory_test.go @@ -10,6 +10,7 @@ import ( "github.com/stretchr/testify/require" "gitlab.com/gitlab-org/gitaly/internal/git" + "gitlab.com/gitlab-org/gitaly/internal/git/gittest" "gitlab.com/gitlab-org/gitaly/internal/helper/text" "gitlab.com/gitlab-org/gitaly/internal/testhelper" "gitlab.com/gitlab-org/gitaly/internal/testhelper/testcfg" @@ -63,9 +64,8 @@ func TestExecCommandFactory_NewWithDir(t *testing.T) { t.Run("runs in dir", func(t *testing.T) { repoPath := testhelper.TempDir(t) - testhelper.MustRunCommand(t, nil, "git", "init", repoPath) - testhelper.MustRunCommand(t, nil, "git", "-C", repoPath, "commit", "--allow-empty", - "-m", "initial commit") + gittest.Exec(t, cfg, "init", repoPath) + gittest.Exec(t, cfg, "-C", repoPath, "commit", "--allow-empty", "-m", "initial commit") ctx, cancel := testhelper.Context() defer cancel() |