aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/reference_test.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2017-07-07 12:25:18 +0200
committerSantiago M. Mola <santi@mola.io>2017-07-07 12:25:18 +0200
commit61884bbfb0690872cc4b9f0a2a6b1aeb83e7dd3a (patch)
treef67c8ad271a4c9d85fff6dfb7439f062aded9f00 /plumbing/reference_test.go
parent102d4b5aeb9b3cbd544c59706a1b0dd9300ddcc8 (diff)
downloadgo-git-61884bbfb0690872cc4b9f0a2a6b1aeb83e7dd3a.tar.gz
fix reference shortening
Implemented according to git shorten_unambiguous_ref. See: https://github.com/git/git/blob/e0aaa1b6532cfce93d87af9bc813fb2e7a7ce9d7/refs.c#L1030
Diffstat (limited to 'plumbing/reference_test.go')
-rw-r--r--plumbing/reference_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/plumbing/reference_test.go b/plumbing/reference_test.go
index 6a695f4..97c8772 100644
--- a/plumbing/reference_test.go
+++ b/plumbing/reference_test.go
@@ -23,6 +23,11 @@ func (s *ReferenceSuite) TestReferenceNameWithSlash(c *C) {
c.Assert(r.Short(), Equals, "origin/feature/AllowSlashes")
}
+func (s *ReferenceSuite) TestReferenceNameNote(c *C) {
+ r := ReferenceName("refs/notes/foo")
+ c.Assert(r.Short(), Equals, "notes/foo")
+}
+
func (s *ReferenceSuite) TestNewReferenceFromStrings(c *C) {
r := NewReferenceFromStrings("refs/heads/v4", "6ecf0ef2c2dffb796033e5a02219af86ec6584e5")
c.Assert(r.Type(), Equals, HashReference)