Bläddra i källkod

Fix typing issues. Fixes #1521 (#1551)

Jelmer Vernooij 2 veckor sedan
förälder
incheckning
cfcb505a9f
2 ändrade filer med 6 tillägg och 3 borttagningar
  1. 3 0
      NEWS
  2. 3 3
      dulwich/client.py

+ 3 - 0
NEWS

@@ -15,6 +15,9 @@
 
  * Bump PyO3 to 0.25. (Jelmer Vernooij)
 
+ * Fix typing for ``dulwich.client`` methods that take repositories.
+   (Jelmer Vernooij, #1521)
+
 0.22.8	2025-03-02
 
  * Allow passing in plain strings to ``dulwich.porcelain.tag_create``

+ 3 - 3
dulwich/client.py

@@ -129,7 +129,7 @@ from .refs import (
     read_info_refs,
     split_peeled_refs,
 )
-from .repo import Repo
+from .repo import BaseRepo, Repo
 
 # Default ref prefix, used if none is specified.
 # GitHub defaults to just sending HEAD if no ref-prefix is
@@ -922,7 +922,7 @@ class GitClient:
     def fetch(
         self,
         path: str,
-        target: Repo,
+        target: BaseRepo,
         determine_wants: Optional[
             Callable[[dict[bytes, bytes], Optional[int]], list[bytes]]
         ] = None,
@@ -1824,7 +1824,7 @@ class LocalGitClient(GitClient):
     def fetch(
         self,
         path: str,
-        target: Repo,
+        target: BaseRepo,
         determine_wants: Optional[
             Callable[[dict[bytes, bytes], Optional[int]], list[bytes]]
         ] = None,