aboutsummaryrefslogtreecommitdiff
path: root/packed_read_test.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-01-30 17:10:01 +0100
committerGravatar Runxi Yu2026-01-30 17:10:01 +0100
commitf762271dbfc121eaac7eb59c0beb01620a09118f (patch)
tree7abee7bf666227312088cdb112f6557864adaecb /packed_read_test.go
parentpacked, delta: Implement thin packs (diff)
signatureNo signature
test: Make gitCmd accept an stdin []byte
Diffstat (limited to 'packed_read_test.go')
-rw-r--r--packed_read_test.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/packed_read_test.go b/packed_read_test.go
index 184a4e5c..077e0166 100644
--- a/packed_read_test.go
+++ b/packed_read_test.go
@@ -13,7 +13,7 @@ func TestPackfileRead(t *testing.T) {
repoPath, cleanup := setupTestRepo(t)
defer cleanup()
- gitCmd(t, repoPath, "config", "gc.auto", "0")
+ gitCmd(t, repoPath, nil, "config", "gc.auto", "0")
workDir, cleanupWork := setupWorkDir(t)
defer cleanupWork()
@@ -27,11 +27,11 @@ func TestPackfileRead(t *testing.T) {
t.Fatalf("failed to write file2.txt: %v", err)
}
- gitCmd(t, repoPath, "--work-tree="+workDir, "add", ".")
- gitCmd(t, repoPath, "--work-tree="+workDir, "commit", "-m", "Test commit")
- commitHash := gitCmd(t, repoPath, "rev-parse", "HEAD")
+ gitCmd(t, repoPath, nil, "--work-tree="+workDir, "add", ".")
+ gitCmd(t, repoPath, nil, "--work-tree="+workDir, "commit", "-m", "Test commit")
+ commitHash := gitCmd(t, repoPath, nil, "rev-parse", "HEAD")
- gitCmd(t, repoPath, "repack", "-a", "-d")
+ gitCmd(t, repoPath, nil, "repack", "-a", "-d")
repo, err := OpenRepository(repoPath)
if err != nil {
@@ -64,7 +64,7 @@ func TestPackfileRead(t *testing.T) {
t.Errorf("tree entries: got %d, want 2", len(tree.Entries))
}
- gitLsTree := gitCmd(t, repoPath, "ls-tree", commit.Tree.String())
+ gitLsTree := gitCmd(t, repoPath, nil, "ls-tree", commit.Tree.String())
for _, entry := range tree.Entries {
if !strings.Contains(gitLsTree, string(entry.Name)) {
t.Errorf("git ls-tree doesn't contain %s", entry.Name)
@@ -80,7 +80,7 @@ func TestPackfileLarge(t *testing.T) {
repoPath, cleanup := setupTestRepo(t)
defer cleanup()
- gitCmd(t, repoPath, "config", "gc.auto", "0")
+ gitCmd(t, repoPath, nil, "config", "gc.auto", "0")
workDir, cleanupWork := setupWorkDir(t)
defer cleanupWork()
@@ -95,11 +95,11 @@ func TestPackfileLarge(t *testing.T) {
}
}
- gitCmd(t, repoPath, "--work-tree="+workDir, "add", ".")
- gitCmd(t, repoPath, "--work-tree="+workDir, "commit", "-m", "Large commit")
- commitHash := gitCmd(t, repoPath, "rev-parse", "HEAD")
+ gitCmd(t, repoPath, nil, "--work-tree="+workDir, "add", ".")
+ gitCmd(t, repoPath, nil, "--work-tree="+workDir, "commit", "-m", "Large commit")
+ commitHash := gitCmd(t, repoPath, nil, "rev-parse", "HEAD")
- gitCmd(t, repoPath, "repack", "-a", "-d")
+ gitCmd(t, repoPath, nil, "repack", "-a", "-d")
repo, err := OpenRepository(repoPath)
if err != nil {
@@ -118,7 +118,7 @@ func TestPackfileLarge(t *testing.T) {
t.Errorf("tree entries: got %d, want %d", len(tree.Entries), numFiles)
}
- gitCount := gitCmd(t, repoPath, "ls-tree", commit.Tree.String())
+ gitCount := gitCmd(t, repoPath, nil, "ls-tree", commit.Tree.String())
gitLines := strings.Count(gitCount, "\n") + 1
if len(tree.Entries) != gitLines {
t.Errorf("furgit found %d entries, git found %d", len(tree.Entries), gitLines)