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

Sign up
Appearance settings

Commit 35f7e94

Browse files
SjordByron
authored andcommitted
Extend IterableList[PushInfo] instead of IterableList
1 parent e67e458 commit 35f7e94

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

‎git/remote.py‎

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -116,23 +116,6 @@ def to_progress_instance(progress: Union[Callable[..., Any], RemoteProgress, Non
116116
return progress
117117

118118

119-
class PushInfoList(IterableList):
120-
def __new__(cls) -> 'PushInfoList':
121-
base = super().__new__(cls, 'push_infos')
122-
return cast(PushInfoList, base)
123-
124-
def __init__(self) -> None:
125-
super().__init__('push_infos')
126-
self.error: Optional[Exception] = None
127-
128-
def raise_if_error(self) -> None:
129-
"""
130-
Raise an exception if any ref failed to push.
131-
"""
132-
if self.error:
133-
raise self.error
134-
135-
136119
class PushInfo(IterableObj, object):
137120
"""
138121
Carries information about the result of a push operation of a single head::
@@ -252,6 +235,22 @@ def iter_items(cls, repo: 'Repo', *args: Any, **kwargs: Any
252235
raise NotImplementedError
253236

254237

238+
class PushInfoList(IterableList[PushInfo]):
239+
def __new__(cls) -> 'PushInfoList':
240+
return cast(PushInfoList, IterableList.__new__(cls, 'push_infos'))
241+
242+
def __init__(self) -> None:
243+
super().__init__('push_infos')
244+
self.error: Optional[Exception] = None
245+
246+
def raise_if_error(self) -> None:
247+
"""
248+
Raise an exception if any ref failed to push.
249+
"""
250+
if self.error:
251+
raise self.error
252+
253+
255254
class FetchInfo(IterableObj, object):
256255

257256
"""

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /