summaryrefslogtreecommitdiff
path: root/morphlib/gitdir_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'morphlib/gitdir_tests.py')
-rw-r--r--morphlib/gitdir_tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/morphlib/gitdir_tests.py b/morphlib/gitdir_tests.py
index 456e3716..10b3b7e5 100644
--- a/morphlib/gitdir_tests.py
+++ b/morphlib/gitdir_tests.py
@@ -162,6 +162,13 @@ class GitDirectoryContentsTests(unittest.TestCase):
self.assertEqual(len(tree), 40)
self.assertNotEqual(commit, tree)
+ def test_ref_exists(self):
+ gd = morphlib.gitdir.GitDirectory(self.dirname)
+ self.assertFalse(gd.ref_exists('non-existant-ref'))
+ self.assertTrue(gd.ref_exists('master'))
+ self.assertFalse(
+ gd.ref_exists('0000000000000000000000000000000000000000'))
+
def test_store_blob_with_string(self):
gd = morphlib.gitdir.GitDirectory(self.dirname)
sha1 = gd.store_blob('test string')