Skip to content

Commit a9756bc

Browse files
committed
Fix typing so that code can run
1 parent 8469a12 commit a9756bc

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

git/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ def _assure_writable(self, method_name: str) -> None:
766766
if self.read_only:
767767
raise IOError("Cannot execute non-constant method %s.%s" % (self, method_name))
768768

769-
def add_section(self, section: str | cp._UNNAMED_SECTION) -> None:
769+
def add_section(self, section: "cp._SectionName") -> None:
770770
"""Assures added options will stay in order."""
771771
return super().add_section(section)
772772

git/objects/submodule/base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
)
2626
from git.objects.base import IndexObject, Object
2727
from git.objects.util import TraversableIterableObj
28-
from ...refs.remote import RemoteReference
2928
from git.util import (
3029
IterableList,
3130
RemoteProgress,
@@ -67,7 +66,7 @@
6766
if TYPE_CHECKING:
6867
from git.index import IndexFile
6968
from git.objects.commit import Commit
70-
from git.refs import Head
69+
from git.refs import Head, RemoteReference
7170
from git.repo import Repo
7271

7372
# -----------------------------------------------------------------------------
@@ -356,7 +355,7 @@ def _clone_repo(
356355
module_checkout_path = osp.join(str(repo.working_tree_dir), path)
357356

358357
if url.startswith("../"):
359-
remote_name = cast(RemoteReference, repo.active_branch.tracking_branch()).remote_name
358+
remote_name = cast("RemoteReference", repo.active_branch.tracking_branch()).remote_name
360359
repo_remote_url = repo.remote(remote_name).url
361360
url = os.path.join(repo_remote_url, url)
362361

0 commit comments

Comments
 (0)