Skip to content

Commit 3b40eae

Browse files
committed
Minor fix for #6
1 parent b924465 commit 3b40eae

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

utlis.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,12 @@ func filepathFromSHA1(rootdir, sha1 string) string {
8181
}
8282

8383
func RefEndName(refStr string) string {
84-
if strings.HasPrefix(refStr, "refs/heads/") {
85-
// trim the "refs/heads/"
86-
return refStr[len("refs/heads/"):]
84+
if strings.HasPrefix(refStr, BRANCH_PREFIX) {
85+
return refStr[len(BRANCH_PREFIX):]
8786
}
8887

89-
if strings.HasPrefix(refStr, "refs/tags/") {
90-
// trim the "refs/heads/"
91-
return refStr[len("refs/tags/"):]
88+
if strings.HasPrefix(refStr, TAG_PREFIX) {
89+
return refStr[len(TAG_PREFIX):]
9290
}
9391

9492
return refStr

0 commit comments

Comments
 (0)