Browse Source

Fix style.

Jelmer Vernooij 2 years ago
parent
commit
d8dea76385
5 changed files with 7 additions and 11 deletions
  1. 5 5
      dulwich/object_store.py
  2. 1 3
      dulwich/pack.py
  3. 1 1
      dulwich/porcelain.py
  4. 0 1
      dulwich/repo.py
  5. 0 1
      dulwich/tests/test_greenthreads.py

+ 5 - 5
dulwich/object_store.py

@@ -28,7 +28,7 @@ import stat
 import sys
 import warnings
 
-from typing import Callable, Dict, List, Optional, Tuple, Protocol, Union, Iterator, Set, Iterable, Sequence, cast
+from typing import Callable, Dict, List, Optional, Tuple, Protocol, Iterator, Set, Iterable, Sequence, cast
 
 from dulwich.errors import (
     NotTreeError,
@@ -1280,11 +1280,11 @@ class MissingObjectFinder:
         missing_tags = want_tags.difference(have_tags)
         self.objects_to_send.update(
             {(w, None, Tag.type_num, False)
-            for w in missing_tags})
+             for w in missing_tags})
         missing_others = want_others.difference(have_others)
         self.objects_to_send.update(
             {(w, None, None, False)
-            for w in missing_others})
+             for w in missing_others})
 
         if progress is None:
             self.progress = lambda x: None
@@ -1355,8 +1355,8 @@ class ObjectStoreGraphWalker:
         self.shallow = shallow
 
     def nak(self):
-        """Nothing incommon was found."""
-        pass
+        """Nothing in common was found."""
+
     def ack(self, sha):
         """Ack that a revision and its ancestors are present in the source."""
         if len(sha) != 40:

+ 1 - 3
dulwich/pack.py

@@ -979,7 +979,7 @@ class PackStreamReader:
     def __len__(self):
         return self._num_objects
 
-    def read_objects(self, compute_crc32=False):
+    def read_objects(self, compute_crc32=False) -> Iterator[UnpackedObject]:
         """Read the objects in this pack file.
 
         Args:
@@ -1873,7 +1873,6 @@ def generate_unpacked_objects(
             yield full_unpacked_object(container[oid])
 
 
-
 def full_unpacked_object(o: ShaFile) -> UnpackedObject:
     return UnpackedObject(
         o.type_num, delta_base=None, crc32=None,
@@ -1918,7 +1917,6 @@ def write_pack_from_container(
     )
 
 
-
 def write_pack_objects(
         write,
         objects: Union[Sequence[ShaFile], Sequence[Tuple[ShaFile, Optional[bytes]]]],

+ 1 - 1
dulwich/porcelain.py

@@ -1769,7 +1769,7 @@ def pack_objects(repo, object_ids, packf, idxf, delta_window_size=None, deltify=
     with open_repo_closing(repo) as r:
         entries, data_sum = write_pack_from_container(
             packf.write,
-            repo.object_store,
+            r.object_store,
             [(oid, None) for oid in object_ids],
             deltify=deltify,
             delta_window_size=delta_window_size,

+ 0 - 1
dulwich/repo.py

@@ -75,7 +75,6 @@ from dulwich.object_store import (
     PackBasedObjectStore,
     ObjectStoreGraphWalker,
     peel_sha,
-    MissingObjectFinder,
 )
 from dulwich.objects import (
     check_hexsha,

+ 0 - 1
dulwich/tests/test_greenthreads.py

@@ -28,7 +28,6 @@ from dulwich.tests import (
 )
 from dulwich.object_store import (
     MemoryObjectStore,
-    MissingObjectFinder,
 )
 from dulwich.objects import (
     Commit,