diff options
| author | Anton Medvedev <anton@medv.io> | 2025-12-07 20:07:15 +0100 |
|---|---|---|
| committer | Anton Medvedev <anton@medv.io> | 2025-12-07 20:07:15 +0100 |
| commit | 59608fd41c1ec2bdab8dfebbb1786bd84d8b5fa1 (patch) | |
| tree | 14a457e1594840d893aa3c042a4566a9a3f65f91 /pkg | |
| parent | 1441fb29d93481f7bea76bbfa2a9f289ed1ac4f0 (diff) | |
Rename `Ref` method with `String`
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/git/git.go | 6 | ||||
| -rw-r--r-- | pkg/git/types.go | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/pkg/git/git.go b/pkg/git/git.go index 7fc28fa..4fd551a 100644 --- a/pkg/git/git.go +++ b/pkg/git/git.go @@ -94,7 +94,7 @@ func Files(ref Ref, repoDir string) ([]Blob, error) { // -r: recurse into subtrees // -l: include blob size - cmd := exec.Command("git", "ls-tree", "--full-tree", "-r", "-l", ref.Ref()) + cmd := exec.Command("git", "ls-tree", "--full-tree", "-r", "-l", ref.String()) if repoDir != "" { cmd.Dir = repoDir } @@ -200,7 +200,7 @@ func BlobContent(ref Ref, path string, repoDir string) ([]byte, bool, error) { ref = NewRef("HEAD") } // Use `git show ref:path` to get the blob content at that ref - cmd := exec.Command("git", "show", ref.Ref()+":"+path) + cmd := exec.Command("git", "show", ref.String()+":"+path) if repoDir != "" { cmd.Dir = repoDir } @@ -233,7 +233,7 @@ func Commits(ref Ref, repoDir string) ([]Commit, error) { "--date=unix", "--pretty=format:" + strings.Join(format, "\x1F"), "-z", // Separate the commits with NULs instead of newlines - ref.Ref(), + ref.String(), } cmd := exec.Command("git", args...) diff --git a/pkg/git/types.go b/pkg/git/types.go index 121c7d8..1469976 100644 --- a/pkg/git/types.go +++ b/pkg/git/types.go @@ -20,7 +20,7 @@ func (r Ref) IsEmpty() bool { return r.ref == "" } -func (r Ref) Ref() string { +func (r Ref) String() string { return r.ref } |
