Skip to content
This repository was archived by the owner on Apr 12, 2019. It is now read-only.

Commit 6798d0f

Browse files
authored
Make GetRefCommitID exported (#107)
1 parent f4a9105 commit 6798d0f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

repo_commit.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111
"strings"
1212
)
1313

14-
// getRefCommitID returns the last commit ID string of given reference (branch or tag).
15-
func (repo *Repository) getRefCommitID(name string) (string, error) {
14+
// GetRefCommitID returns the last commit ID string of given reference (branch or tag).
15+
func (repo *Repository) GetRefCommitID(name string) (string, error) {
1616
stdout, err := NewCommand("show-ref", "--verify", name).RunInDir(repo.Path)
1717
if err != nil {
1818
if strings.Contains(err.Error(), "not a valid ref") {
@@ -25,12 +25,12 @@ func (repo *Repository) getRefCommitID(name string) (string, error) {
2525

2626
// GetBranchCommitID returns last commit ID string of given branch.
2727
func (repo *Repository) GetBranchCommitID(name string) (string, error) {
28-
return repo.getRefCommitID(BranchPrefix + name)
28+
return repo.GetRefCommitID(BranchPrefix + name)
2929
}
3030

3131
// GetTagCommitID returns last commit ID string of given tag.
3232
func (repo *Repository) GetTagCommitID(name string) (string, error) {
33-
return repo.getRefCommitID(TagPrefix + name)
33+
return repo.GetRefCommitID(TagPrefix + name)
3434
}
3535

3636
// parseCommitData parses commit information from the (uncompressed) raw

0 commit comments

Comments
 (0)