aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/hash_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2020-05-10 11:02:21 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2020-05-10 11:02:21 +0200
commit21f106e6647ce70d1d40df65cd85e2e86264d2f0 (patch)
tree4e92440758cc6e3901d2467405225144cfe29fea /plumbing/hash_test.go
parent79798d4a85b9389b28ef26b70944157d16fc205a (diff)
downloadgo-git-21f106e6647ce70d1d40df65cd85e2e86264d2f0.tar.gz
config: RefSpec.IsExactSHA1, validates if the refspec describes an exact SHA1 ref
Diffstat (limited to 'plumbing/hash_test.go')
-rw-r--r--plumbing/hash_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/plumbing/hash_test.go b/plumbing/hash_test.go
index fc2428b..0f836b0 100644
--- a/plumbing/hash_test.go
+++ b/plumbing/hash_test.go
@@ -52,3 +52,9 @@ func (s *HashSuite) TestHashesSort(c *C) {
c.Assert(i[0], Equals, NewHash("1111111111111111111111111111111111111111"))
c.Assert(i[1], Equals, NewHash("2222222222222222222222222222222222222222"))
}
+
+func (s *HashSuite) TestIsHash(c *C) {
+ c.Assert(IsHash("8ab686eafeb1f44702738c8b0f24f2567c36da6d"), Equals, true)
+ c.Assert(IsHash("foo"), Equals, false)
+ c.Assert(IsHash("zab686eafeb1f44702738c8b0f24f2567c36da6d"), Equals, false)
+}