Browse Source

Verify commit follows symbolic refs.

Jelmer Vernooij 9 years ago
parent
commit
5d6a9890dc
1 changed files with 11 additions and 0 deletions
  1. 11 0
      dulwich/tests/test_repository.py

+ 11 - 0
dulwich/tests/test_repository.py

@@ -587,6 +587,17 @@ class BuildRepoRootTests(TestCase):
         tree = r[r[commit_sha].tree]
         self.assertEqual([], list(tree.iteritems()))
 
+    def test_commit_follows(self):
+        r = self._repo
+        r.refs.set_symbolic_ref(b'HEAD', b'refs/heads/bla')
+        commit_sha = r.do_commit(b'commit with strange character',
+             committer=b'Test Committer <test@nodomain.com>',
+             author=b'Test Author <test@nodomain.com>',
+             commit_timestamp=12395, commit_timezone=0,
+             author_timestamp=12395, author_timezone=0,
+             ref=b'HEAD')
+        self.assertEqual(commit_sha, r[b'refs/heads/bla'].id)
+
     def test_commit_encoding(self):
         r = self._repo
         commit_sha = r.do_commit(b'commit with strange character \xee',