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-12-15 15:14:13 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2021-12-15 16:40:00 +0300
commit68fbbc0ddaf4b229e51a01f76a09595a802d6a62 (patch)
treebabeb0aadf3cb38ffb36a68a22d253e35f3c7d5a /internal
parent3accc9c4912a882fceaeb864bd419a632136f4c6 (diff)
gittest: Drop CreateCommitInAlternateObjectDirectory helper
The `CreateCommitInAlternateObjectDirectory()` helper function has been replaced by a new option for `WriteCommit()` and is now unused. Drop it.
Diffstat (limited to 'internal')
-rw-r--r--internal/git/gittest/commit.go30
1 files changed, 0 insertions, 30 deletions
diff --git a/internal/git/gittest/commit.go b/internal/git/gittest/commit.go
index b7e83ee8e..50ab3aa2c 100644
--- a/internal/git/gittest/commit.go
+++ b/internal/git/gittest/commit.go
@@ -4,7 +4,6 @@ import (
"bytes"
"fmt"
"os"
- "os/exec"
"path/filepath"
"testing"
@@ -161,35 +160,6 @@ func WriteCommit(t testing.TB, cfg config.Cfg, repoPath string, opts ...WriteCom
return oid
}
-// CreateCommitInAlternateObjectDirectory runs a command such that its created
-// objects will live in an alternate objects directory. It returns the current
-// head after the command is run and the alternate objects directory path
-func CreateCommitInAlternateObjectDirectory(t testing.TB, gitBin, repoPath, altObjectsDir string, cmd *exec.Cmd) (currentHead []byte) {
- gitPath := filepath.Join(repoPath, ".git")
-
- altObjectsPath := filepath.Join(gitPath, altObjectsDir)
- gitObjectEnv := []string{
- fmt.Sprintf("GIT_OBJECT_DIRECTORY=%s", altObjectsPath),
- fmt.Sprintf("GIT_ALTERNATE_OBJECT_DIRECTORIES=%s", filepath.Join(gitPath, "objects")),
- }
- require.NoError(t, os.MkdirAll(altObjectsPath, 0o755))
-
- // Because we set 'gitObjectEnv', the new objects created by this command
- // will go into 'find-commits-alt-test-repo/.git/alt-objects'.
- cmd.Env = append(cmd.Env, gitObjectEnv...)
- if output, err := cmd.Output(); err != nil {
- stderr := err.(*exec.ExitError).Stderr
- t.Fatalf("stdout: %s, stderr: %s", output, stderr)
- }
-
- cmd = exec.Command(gitBin, "-C", repoPath, "rev-parse", "HEAD")
- cmd.Env = gitObjectEnv
- currentHead, err := cmd.Output()
- require.NoError(t, err)
-
- return currentHead[:len(currentHead)-1]
-}
-
func authorEqualIgnoringDate(t testing.TB, expected *gitalypb.CommitAuthor, actual *gitalypb.CommitAuthor) {
t.Helper()
require.Equal(t, expected.GetName(), actual.GetName(), "author name does not match")