|
12 | 12 |
|
13 | 13 | # typing ------------------------------------------------------------------- |
14 | 14 |
|
15 | | -fromtypingimportTYPE_CHECKING |
| 15 | +fromtypingimportTYPE_CHECKING, Union |
| 16 | + |
| 17 | +fromgit.typesimportCommit_ish |
16 | 18 |
|
17 | 19 | ifTYPE_CHECKING: |
18 | 20 | fromgit.repoimportRepo |
| 21 | +fromgit.utilimportIterableList |
19 | 22 |
|
20 | 23 | # ---------------------------------------------------------------------------- |
21 | 24 |
|
@@ -70,9 +73,11 @@ def _clear_cache(self) -> None: |
70 | 73 |
|
71 | 74 | #{Interface |
72 | 75 |
|
73 | | -defupdate(self, previous_commit=None, recursive=True, force_remove=False, init=True, |
74 | | -to_latest_revision=False, progress=None, dry_run=False, force_reset=False, |
75 | | -keep_going=False): |
| 76 | +defupdate(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': |
76 | 81 | """Update the submodules of this repository to the current HEAD commit. |
77 | 82 | This method behaves smartly by determining changes of the path of a submodules |
78 | 83 | repository, next to changes to the to-be-checked-out commit or the branch to be |
@@ -137,8 +142,8 @@ def update(self, previous_commit=None, recursive=True, force_remove=False, init= |
137 | 142 | previous_commit=repo.commit(previous_commit) # obtain commit object |
138 | 143 | # END handle previous commit |
139 | 144 |
|
140 | | -psms=self.list_items(repo, parent_commit=previous_commit) |
141 | | -sms=self.list_items(repo) |
| 145 | +psms: 'IterableList[Submodule]'=self.list_items(repo, parent_commit=previous_commit) |
| 146 | +sms: 'IterableList[Submodule]'=self.list_items(repo) |
142 | 147 | spsms=set(psms) |
143 | 148 | ssms=set(sms) |
144 | 149 |
|
@@ -171,8 +176,8 @@ def update(self, previous_commit=None, recursive=True, force_remove=False, init= |
171 | 176 | csms= (spsms&ssms) |
172 | 177 | len_csms=len(csms) |
173 | 178 | fori, csminenumerate(csms): |
174 | | -psm=psms[csm.name] |
175 | | -sm=sms[csm.name] |
| 179 | +psm: 'Submodule'=psms[csm.name] |
| 180 | +sm: 'Submodule'=sms[csm.name] |
176 | 181 |
|
177 | 182 | # PATH CHANGES |
178 | 183 | ############## |
|
0 commit comments