Skip to content

Commit

Permalink
Minor fix for #6
Browse files Browse the repository at this point in the history
  • Loading branch information
unknwon committed Feb 11, 2016
1 parent b924465 commit 3b40eae
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions utlis.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,12 @@ func filepathFromSHA1(rootdir, sha1 string) string {
}

func RefEndName(refStr string) string {
if strings.HasPrefix(refStr, "refs/heads/") {
// trim the "refs/heads/"
return refStr[len("refs/heads/"):]
if strings.HasPrefix(refStr, BRANCH_PREFIX) {
return refStr[len(BRANCH_PREFIX):]
}

if strings.HasPrefix(refStr, "refs/tags/") {
// trim the "refs/heads/"
return refStr[len("refs/tags/"):]
if strings.HasPrefix(refStr, TAG_PREFIX) {
return refStr[len(TAG_PREFIX):]
}

return refStr
Expand Down

0 comments on commit 3b40eae

Please sign in to comment.