ソースを参照

Change the unrelated graph test to fetch only

- This removes the need to generate new commits with a test
- Also clarify the relevant section of code this affects.
Tommy Yu 10 年 前
コミット
919ab3c080
2 ファイル変更7 行追加10 行削除
  1. 2 1
      dulwich/server.py
  2. 5 9
      dulwich/tests/compat/server_utils.py

+ 2 - 1
dulwich/server.py

@@ -681,7 +681,8 @@ class BaseGraphWalkerImpl(object):
 
         if not done_received and not self._common:
             # Okay we are not actually done then since the walker picked
-            # up no haves.
+            # up no haves.  This is usually triggered when client attempts
+            # to pull from a source that has no common base_commit.
             return False
 
         self.post_nodone_check()

+ 5 - 9
dulwich/tests/compat/server_utils.py

@@ -266,16 +266,12 @@ class ServerTests(object):
         self.addCleanup(tear_down_repo, self._client_repo)
         port = self._start_server(self._source_repo)
 
-        run_git_or_fail(['config', 'user.email', 'user@example.com'],
+        self.assertRaises(KeyError, self._client_repo.get_object,
+            '02a14da1fc1fc13389bbf32f0af7d8899f2b2323')
+        run_git_or_fail(['fetch', self.url(port), 'master',],
                         cwd=self._client_repo.path)
-        run_git_or_fail(['config', 'user.name', 'User Name'],
-                        cwd=self._client_repo.path)
-        run_git_or_fail(['pull', self.url(port), 'master',],
-                        cwd=self._client_repo.path)
-        # the merge commit will be automatic so hashes are different,
-        # however it being a working directory and done with git it has
-        # a rather predictable result, assuming a default strategy.
-        self.assertEqual(len(os.listdir(self._client_repo.path)), 8)
+        self.assertEqual('commit', self._client_repo.get_object(
+            '02a14da1fc1fc13389bbf32f0af7d8899f2b2323').type_name)
 
     def test_push_to_dulwich_issue_88_standard(self):
         # Same thing, but we reverse the role of the server/client