소스 검색

Verify commit follows symbolic refs.

Jelmer Vernooij 9 년 전
부모
커밋
5d6a9890dc
1개의 변경된 파일11개의 추가작업 그리고 0개의 파일을 삭제
  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',