aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/hash_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2020-05-11 00:28:21 +0200
committerGitHub <noreply@github.com>2020-05-11 00:28:21 +0200
commit568154cab87659b31c751678c7f7dc93fedf60af (patch)
tree233f993126f9346b06979202042bd5d95ba70bf2 /plumbing/hash_test.go
parente4166c560bfa0bcdadd3197ad00365b4f1c027fb (diff)
parent8ecd388ae101a0dd88b78dc47ebfef9fe51699df (diff)
downloadgo-git-568154cab87659b31c751678c7f7dc93fedf60af.tar.gz
Merge pull request #58 from go-git/exact-sha1
Remote.Fetch: support exact SHA1 refspecs
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)
+}