浏览代码

Fix flaky/failing tests introduced in the last few changes.

Change-Id: Ie87a60d970638c4682970a9b4f47d8240de49532
Dave Borowitz 15 年之前
父节点
当前提交
2a9e8a0de8
共有 2 个文件被更改,包括 2 次插入1 次删除
  1. 1 0
      dulwich/repo.py
  2. 1 1
      dulwich/tests/test_server.py

+ 1 - 0
dulwich/repo.py

@@ -402,6 +402,7 @@ class DiskRefsContainer(RefsContainer):
         """
         self._check_refname(name)
         filename = self.refpath(name)
+        ensure_dir_exists(os.path.dirname(filename))
         f = GitFile(filename, 'wb')
         try:
             if old_ref is not None:

+ 1 - 1
dulwich/tests/test_server.py

@@ -202,7 +202,7 @@ class ProtocolGraphWalkerTestCase(TestCase):
         self.assertRaises(GitProtocolError, self._walker.determine_wants, heads)
 
         self._walker.proto.set_output([])
-        self.assertRaises(GitProtocolError, self._walker.determine_wants, heads)
+        self.assertEquals([], self._walker.determine_wants(heads))
 
         self._walker.proto.set_output(['want %s multi_ack' % ONE, 'foo'])
         self.assertRaises(GitProtocolError, self._walker.determine_wants, heads)