Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eecf148

Browse filesBrowse files
committed
Rmv root.py types
1 parent ed58e2f commit eecf148
Copy full SHA for eecf148

2 files changed

+12-26Lines changed: 12 additions & 26 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎git/objects/submodule/base.py‎

Copy file name to clipboardExpand all lines: git/objects/submodule/base.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ def set_parent_commit(self, commit: Union[Commit_ish, None], check: bool = True)
10151015
# If check is False, we might see a parent-commit that doesn't even contain the submodule anymore.
10161016
# in that case, mark our sha as being NULL
10171017
try:
1018-
self.binsha = pctree[self.path].binsha # type: ignore # str()?
1018+
self.binsha = pctree[str(self.path)].binsha
10191019
except KeyError:
10201020
self.binsha = self.NULL_BIN_SHA
10211021
# end
@@ -1080,7 +1080,7 @@ def rename(self, new_name: str) -> 'Submodule':
10801080
destination_module_abspath = self._module_abspath(self.repo, self.path, new_name)
10811081
source_dir = mod.git_dir
10821082
# Let's be sure the submodule name is not so obviously tied to a directory
1083-
if destination_module_abspath.startswith(str(mod.git_dir)): # type: ignore # str()?
1083+
if str(destination_module_abspath).startswith(str(mod.git_dir)):
10841084
tmp_dir = self._module_abspath(self.repo, self.path, str(uuid.uuid4()))
10851085
os.renames(source_dir, tmp_dir)
10861086
source_dir = tmp_dir
Collapse file

‎git/objects/submodule/root.py‎

Copy file name to clipboardExpand all lines: git/objects/submodule/root.py
+10-24Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,6 @@
1010

1111
import logging
1212

13-
# typing -------------------------------------------------------------------
14-
15-
from typing import TYPE_CHECKING, Union
16-
17-
from git.types import Commit_ish
18-
19-
if TYPE_CHECKING:
20-
from git.repo import Repo
21-
from git.util import IterableList
22-
23-
# ----------------------------------------------------------------------------
24-
2513
__all__ = ["RootModule", "RootUpdateProgress"]
2614

2715
log = logging.getLogger('git.objects.submodule.root')
@@ -54,7 +42,7 @@ class RootModule(Submodule):
5442

5543
k_root_name = '__ROOT__'
5644

57-
def __init__(self, repo: 'Repo'):
45+
def __init__(self, repo):
5846
# repo, binsha, mode=None, path=None, name = None, parent_commit=None, url=None, ref=None)
5947
super(RootModule, self).__init__(
6048
repo,
@@ -67,17 +55,15 @@ def __init__(self, repo: 'Repo'):
6755
branch_path=git.Head.to_full_path(self.k_head_default)
6856
)
6957

70-
def _clear_cache(self) -> None:
58+
def _clear_cache(self):
7159
"""May not do anything"""
7260
pass
7361

7462
#{ Interface
7563

76-
def update(self, previous_commit: Union[Commit_ish, None] = None, # type: ignore[override]
77-
recursive: bool = True, force_remove: bool = False, init: bool = True,
78-
to_latest_revision: bool = False, progress: Union[None, 'RootUpdateProgress'] = None,
79-
dry_run: bool = False, force_reset: bool = False, keep_going: bool = False
80-
) -> 'RootModule':
64+
def update(self, previous_commit=None, recursive=True, force_remove=False, init=True,
65+
to_latest_revision=False, progress=None, dry_run=False, force_reset=False,
66+
keep_going=False):
8167
"""Update the submodules of this repository to the current HEAD commit.
8268
This method behaves smartly by determining changes of the path of a submodules
8369
repository, next to changes to the to-be-checked-out commit or the branch to be
@@ -142,8 +128,8 @@ def update(self, previous_commit: Union[Commit_ish, None] = None,
142128
previous_commit = repo.commit(previous_commit) # obtain commit object
143129
# END handle previous commit
144130

145-
psms: 'IterableList[Submodule]' = self.list_items(repo, parent_commit=previous_commit)
146-
sms: 'IterableList[Submodule]' = self.list_items(repo)
131+
psms = self.list_items(repo, parent_commit=previous_commit)
132+
sms = self.list_items(repo)
147133
spsms = set(psms)
148134
ssms = set(sms)
149135

@@ -176,8 +162,8 @@ def update(self, previous_commit: Union[Commit_ish, None] = None,
176162
csms = (spsms & ssms)
177163
len_csms = len(csms)
178164
for i, csm in enumerate(csms):
179-
psm: 'Submodule' = psms[csm.name]
180-
sm: 'Submodule' = sms[csm.name]
165+
psm = psms[csm.name]
166+
sm = sms[csm.name]
181167

182168
# PATH CHANGES
183169
##############
@@ -357,7 +343,7 @@ def update(self, previous_commit: Union[Commit_ish, None] = None,
357343

358344
return self
359345

360-
def module(self) -> 'Repo':
346+
def module(self):
361347
""":return: the actual repository containing the submodules"""
362348
return self.repo
363349
#} END interface

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.