From f762271dbfc121eaac7eb59c0beb01620a09118f Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Fri, 30 Jan 2026 17:10:01 +0100 Subject: test: Make gitCmd accept an stdin []byte --- obj_tag_test.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'obj_tag_test.go') diff --git a/obj_tag_test.go b/obj_tag_test.go index 6b3c8368..f8f598fd 100644 --- a/obj_tag_test.go +++ b/obj_tag_test.go @@ -19,9 +19,9 @@ func TestTagWrite(t *testing.T) { if err != nil { t.Fatalf("failed to write file.txt: %v", err) } - gitCmd(t, repoPath, "--work-tree="+workDir, "add", ".") - gitCmd(t, repoPath, "--work-tree="+workDir, "commit", "-m", "Tagged 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", "Tagged commit") + commitHash := gitCmd(t, repoPath, nil, "rev-parse", "HEAD") repo, err := OpenRepository(repoPath) if err != nil { @@ -90,12 +90,12 @@ func TestTagRead(t *testing.T) { if err != nil { t.Fatalf("failed to write file.txt: %v", err) } - gitCmd(t, repoPath, "--work-tree="+workDir, "add", ".") - gitCmd(t, repoPath, "--work-tree="+workDir, "commit", "-m", "Commit for tag") - commitHash := gitCmd(t, repoPath, "rev-parse", "HEAD") + gitCmd(t, repoPath, nil, "--work-tree="+workDir, "add", ".") + gitCmd(t, repoPath, nil, "--work-tree="+workDir, "commit", "-m", "Commit for tag") + commitHash := gitCmd(t, repoPath, nil, "rev-parse", "HEAD") - gitCmd(t, repoPath, "tag", "-a", "-m", "Tag message", "v1.0.0", commitHash) - tagHash := gitCmd(t, repoPath, "rev-parse", "v1.0.0") + gitCmd(t, repoPath, nil, "tag", "-a", "-m", "Tag message", "v1.0.0", commitHash) + tagHash := gitCmd(t, repoPath, nil, "rev-parse", "v1.0.0") repo, err := OpenRepository(repoPath) if err != nil { @@ -136,9 +136,9 @@ func TestTagRoundtrip(t *testing.T) { if err != nil { t.Fatalf("failed to write file.txt: %v", err) } - gitCmd(t, repoPath, "--work-tree="+workDir, "add", ".") - gitCmd(t, repoPath, "--work-tree="+workDir, "commit", "-m", "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", "Commit") + commitHash := gitCmd(t, repoPath, nil, "rev-parse", "HEAD") repo, err := OpenRepository(repoPath) if err != nil { -- cgit v1.3.1-10-gc9f91