aboutsummaryrefslogtreecommitdiff
path: root/internal/testgit/repo_refs.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-04 08:26:56 +0800
committerGravatar Runxi Yu2026-03-04 08:59:53 +0800
commitab7501be34032fb9e5c48726a68ae90a917af9eb (patch)
tree20d005647569befea8133e953c3270e8fd2a2a5b /internal/testgit/repo_refs.go
parent*: gofumpt (diff)
signatureNo signature
*: Lint
Diffstat (limited to 'internal/testgit/repo_refs.go')
-rw-r--r--internal/testgit/repo_refs.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/testgit/repo_refs.go b/internal/testgit/repo_refs.go
index eb09a78b..66e08561 100644
--- a/internal/testgit/repo_refs.go
+++ b/internal/testgit/repo_refs.go
@@ -28,6 +28,7 @@ func (testRepo *TestRepo) SymbolicRef(tb testing.TB, name, target string) {
// PackRefs runs git pack-refs with args.
func (testRepo *TestRepo) PackRefs(tb testing.TB, args ...string) {
tb.Helper()
+
cmd := append([]string{"pack-refs"}, args...)
testRepo.Run(tb, cmd...)
}
@@ -35,10 +36,13 @@ func (testRepo *TestRepo) PackRefs(tb testing.TB, args ...string) {
// ShowRef returns lines from git show-ref output.
func (testRepo *TestRepo) ShowRef(tb testing.TB, args ...string) []string {
tb.Helper()
+
cmd := append([]string{"show-ref"}, args...)
+
out := testRepo.Run(tb, cmd...)
if strings.TrimSpace(out) == "" {
return nil
}
+
return strings.Split(strings.TrimSpace(out), "\n")
}