diff options
| author | 2026-02-20 12:41:18 +0800 | |
|---|---|---|
| committer | 2026-02-20 12:57:31 +0800 | |
| commit | e0e56e63defc1cb9cc14081c62bb268de7e15dd7 (patch) | |
| tree | 9698d7daecb4775f500ac937646814a7a25bbe04 /obj_tree_test.go | |
| parent | Revert "packed: Factor out packWriteObjects and clean up" (diff) | |
| signature | No signature | |
Revert "test: Make gitCmd accept an stdin []byte"
This reverts commit f762271dbfc121eaac7eb59c0beb01620a09118f.
Diffstat (limited to 'obj_tree_test.go')
| -rw-r--r-- | obj_tree_test.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/obj_tree_test.go b/obj_tree_test.go index a94f27c3..605e9a15 100644 --- a/obj_tree_test.go +++ b/obj_tree_test.go @@ -39,7 +39,7 @@ func TestTreeWrite(t *testing.T) { t.Errorf("git type: got %q, want %q", gitType, "tree") } - gitLsTree := gitCmd(t, repoPath, nil, "ls-tree", treeHash.String()) + gitLsTree := gitCmd(t, repoPath, "ls-tree", treeHash.String()) if !strings.Contains(gitLsTree, "file.txt") { t.Errorf("git ls-tree doesn't contain file.txt: %s", gitLsTree) } @@ -68,8 +68,8 @@ func TestTreeRead(t *testing.T) { t.Fatalf("failed to write c.txt: %v", err) } - gitCmd(t, repoPath, nil, "--work-tree="+workDir, "add", ".") - treeHash := gitCmd(t, repoPath, nil, "--work-tree="+workDir, "write-tree") + gitCmd(t, repoPath, "--work-tree="+workDir, "add", ".") + treeHash := gitCmd(t, repoPath, "--work-tree="+workDir, "write-tree") repo, err := OpenRepository(repoPath) if err != nil { @@ -124,8 +124,8 @@ func TestTreeEntry(t *testing.T) { t.Fatalf("failed to write c.txt: %v", err) } - gitCmd(t, repoPath, nil, "--work-tree="+workDir, "add", ".") - treeHash := gitCmd(t, repoPath, nil, "--work-tree="+workDir, "write-tree") + gitCmd(t, repoPath, "--work-tree="+workDir, "add", ".") + treeHash := gitCmd(t, repoPath, "--work-tree="+workDir, "write-tree") repo, err := OpenRepository(repoPath) if err != nil { @@ -175,8 +175,8 @@ func TestTreeEntryRecursive(t *testing.T) { t.Fatalf("failed to write dir/nested.txt: %v", err) } - gitCmd(t, repoPath, nil, "--work-tree="+workDir, "add", ".") - treeHash := gitCmd(t, repoPath, nil, "--work-tree="+workDir, "write-tree") + gitCmd(t, repoPath, "--work-tree="+workDir, "add", ".") + treeHash := gitCmd(t, repoPath, "--work-tree="+workDir, "write-tree") repo, err := OpenRepository(repoPath) if err != nil { @@ -233,7 +233,7 @@ func TestTreeLarge(t *testing.T) { repoPath, cleanup := setupTestRepo(t) defer cleanup() - gitCmd(t, repoPath, nil, "config", "gc.auto", "0") + gitCmd(t, repoPath, "config", "gc.auto", "0") workDir, cleanupWork := setupWorkDir(t) defer cleanupWork() @@ -248,8 +248,8 @@ func TestTreeLarge(t *testing.T) { } } - gitCmd(t, repoPath, nil, "--work-tree="+workDir, "add", ".") - treeHash := gitCmd(t, repoPath, nil, "--work-tree="+workDir, "write-tree") + gitCmd(t, repoPath, "--work-tree="+workDir, "add", ".") + treeHash := gitCmd(t, repoPath, "--work-tree="+workDir, "write-tree") repo, err := OpenRepository(repoPath) if err != nil { @@ -265,7 +265,7 @@ func TestTreeLarge(t *testing.T) { t.Errorf("tree entries: got %d, want %d", len(tree.Entries), numFiles) } - gitCount := gitCmd(t, repoPath, nil, "ls-tree", treeHash) + gitCount := gitCmd(t, repoPath, "ls-tree", treeHash) gitLines := strings.Count(gitCount, "\n") + 1 if len(tree.Entries) != gitLines { t.Errorf("furgit found %d entries, git found %d", len(tree.Entries), gitLines) |
