From e0e56e63defc1cb9cc14081c62bb268de7e15dd7 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Fri, 20 Feb 2026 12:41:18 +0800 Subject: Revert "test: Make gitCmd accept an stdin []byte" This reverts commit f762271dbfc121eaac7eb59c0beb01620a09118f. --- obj_commit_test.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'obj_commit_test.go') diff --git a/obj_commit_test.go b/obj_commit_test.go index 6e8a2dc1..939385d5 100644 --- a/obj_commit_test.go +++ b/obj_commit_test.go @@ -87,9 +87,9 @@ func TestCommitRead(t *testing.T) { if err != nil { t.Fatalf("failed to write file.txt: %v", err) } - 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, "--work-tree="+workDir, "add", ".") + gitCmd(t, repoPath, "--work-tree="+workDir, "commit", "-m", "Test commit") + commitHash := gitCmd(t, repoPath, "rev-parse", "HEAD") repo, err := OpenRepository(repoPath) if err != nil { @@ -135,24 +135,24 @@ func TestCommitWithParents(t *testing.T) { if err != nil { t.Fatalf("failed to write file1.txt: %v", err) } - gitCmd(t, repoPath, nil, "--work-tree="+workDir, "add", ".") - gitCmd(t, repoPath, nil, "--work-tree="+workDir, "commit", "-m", "First commit") - parent1Hash := gitCmd(t, repoPath, nil, "rev-parse", "HEAD") + gitCmd(t, repoPath, "--work-tree="+workDir, "add", ".") + gitCmd(t, repoPath, "--work-tree="+workDir, "commit", "-m", "First commit") + parent1Hash := gitCmd(t, repoPath, "rev-parse", "HEAD") err = os.WriteFile(filepath.Join(workDir, "file2.txt"), []byte("content2"), 0o644) if err != nil { t.Fatalf("failed to write file2.txt: %v", err) } - gitCmd(t, repoPath, nil, "--work-tree="+workDir, "add", ".") - gitCmd(t, repoPath, nil, "--work-tree="+workDir, "commit", "-m", "Second commit") - parent2Hash := gitCmd(t, repoPath, nil, "rev-parse", "HEAD") + gitCmd(t, repoPath, "--work-tree="+workDir, "add", ".") + gitCmd(t, repoPath, "--work-tree="+workDir, "commit", "-m", "Second commit") + parent2Hash := gitCmd(t, repoPath, "rev-parse", "HEAD") err = os.WriteFile(filepath.Join(workDir, "file3.txt"), []byte("content3"), 0o644) if err != nil { t.Fatalf("failed to write file3.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") mergeCommitData := fmt.Sprintf("tree %s\nparent %s\nparent %s\nauthor Test Author 1234567890 +0000\ncommitter Test Committer 1234567890 +0000\n\nMerge commit\n", treeHash, parent1Hash, parent2Hash) -- cgit v1.3.1-10-gc9f91