diff options
| author | 2026-02-20 12:41:18 +0800 | |
|---|---|---|
| committer | 2026-02-20 12:57:31 +0800 | |
| commit | e0e56e63defc1cb9cc14081c62bb268de7e15dd7 (patch) | |
| tree | 9698d7daecb4775f500ac937646814a7a25bbe04 /reachability_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 'reachability_test.go')
| -rw-r--r-- | reachability_test.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/reachability_test.go b/reachability_test.go index 4c32b9cd..2a2d5060 100644 --- a/reachability_test.go +++ b/reachability_test.go @@ -20,9 +20,9 @@ func TestReachabilityCommitsWantHave(t *testing.T) { if err := os.WriteFile(path, []byte{byte('a' + i), '\n'}, 0o644); err != nil { t.Fatalf("write file: %v", err) } - gitCmd(t, repoPath, nil, "--work-tree="+workDir, "add", ".") - gitCmd(t, repoPath, nil, "--work-tree="+workDir, "commit", "-m", "commit") - commits = append(commits, gitCmd(t, repoPath, nil, "rev-parse", "HEAD")) + gitCmd(t, repoPath, "--work-tree="+workDir, "add", ".") + gitCmd(t, repoPath, "--work-tree="+workDir, "commit", "-m", "commit") + commits = append(commits, gitCmd(t, repoPath, "rev-parse", "HEAD")) } repo, err := OpenRepository(repoPath) @@ -97,8 +97,8 @@ func TestReachabilityAllObjects(t *testing.T) { if err := os.WriteFile(filepath.Join(workDir, "dir", "file2.txt"), []byte("two\n"), 0o644); err != nil { t.Fatalf("write file2: %v", err) } - gitCmd(t, repoPath, nil, "--work-tree="+workDir, "add", ".") - gitCmd(t, repoPath, nil, "--work-tree="+workDir, "commit", "-m", "commit") + gitCmd(t, repoPath, "--work-tree="+workDir, "add", ".") + gitCmd(t, repoPath, "--work-tree="+workDir, "commit", "-m", "commit") repo, err := OpenRepository(repoPath) if err != nil { @@ -106,7 +106,7 @@ func TestReachabilityAllObjects(t *testing.T) { } defer func() { _ = repo.Close() }() - head := gitCmd(t, repoPath, nil, "rev-parse", "HEAD") + head := gitCmd(t, repoPath, "rev-parse", "HEAD") wantID, _ := repo.ParseHash(head) walk, err := repo.ReachableObjects(ReachabilityQuery{ Wants: []Hash{wantID}, @@ -124,9 +124,9 @@ func TestReachabilityAllObjects(t *testing.T) { t.Fatalf("Reachability walk error: %v", err) } - treeStr := gitCmd(t, repoPath, nil, "show", "-s", "--format=%T", head) + treeStr := gitCmd(t, repoPath, "show", "-s", "--format=%T", head) treeID, _ := repo.ParseHash(treeStr) - lsTree := gitCmd(t, repoPath, nil, "ls-tree", "-r", treeStr) + lsTree := gitCmd(t, repoPath, "ls-tree", "-r", treeStr) fields := strings.Fields(lsTree) if len(fields) < 3 { t.Fatalf("unexpected ls-tree output: %q", lsTree) @@ -157,9 +157,9 @@ func TestReachabilityStopAtHaves(t *testing.T) { if err := os.WriteFile(path, []byte{byte('a' + i), '\n'}, 0o644); err != nil { t.Fatalf("write file: %v", err) } - gitCmd(t, repoPath, nil, "--work-tree="+workDir, "add", ".") - gitCmd(t, repoPath, nil, "--work-tree="+workDir, "commit", "-m", "commit") - commits = append(commits, gitCmd(t, repoPath, nil, "rev-parse", "HEAD")) + gitCmd(t, repoPath, "--work-tree="+workDir, "add", ".") + gitCmd(t, repoPath, "--work-tree="+workDir, "commit", "-m", "commit") + commits = append(commits, gitCmd(t, repoPath, "rev-parse", "HEAD")) } repo, err := OpenRepository(repoPath) |
