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 3be955e

Browse filesBrowse files
committed
Add type to symbolicreference.references()
1 parent 13b38ce commit 3be955e
Copy full SHA for 3be955e

2 files changed

+3-12Lines changed: 3 additions & 12 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/refs/head.py‎

Copy file name to clipboardExpand all lines: git/refs/head.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def __init__(self, repo: 'Repo', path: PathLike = _HEAD_NAME):
4040
raise ValueError("HEAD instance must point to %r, got %r" % (self._HEAD_NAME, path))
4141
super(HEAD, self).__init__(repo, path)
4242
self.commit: 'Commit'
43-
self.ref: 'Head'
4443

4544
def orig_head(self) -> SymbolicReference:
4645
"""
Collapse file

‎git/refs/symbolic.py‎

Copy file name to clipboardExpand all lines: git/refs/symbolic.py
+3-11Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
if TYPE_CHECKING:
2828
from git.repo import Repo
29-
from git.refs import Head, TagReference, Reference
29+
from git.refs import Head, TagReference, RemoteReference, Reference
3030
from .log import RefLogEntry
3131
from git.config import GitConfigParser
3232
from git.objects.commit import Actor
@@ -65,7 +65,6 @@ class SymbolicReference(object):
6565
def __init__(self, repo: 'Repo', path: PathLike, check_path: bool = False):
6666
self.repo = repo
6767
self.path = path
68-
self.ref = self.reference
6968

7069
def __str__(self) -> str:
7170
return str(self.path)
@@ -363,15 +362,8 @@ def set_reference(self, ref: Union[Commit_ish, 'SymbolicReference', str],
363362
return self
364363

365364
# aliased reference
366-
# reference = property(_get_reference, set_reference, doc="Returns the Reference we point to") # type: ignore
367-
368-
@property
369-
def reference(self) -> 'Reference':
370-
return self._get_reference()
371-
372-
@reference.setter
373-
def reference(self, *args, **kwargs):
374-
return self.set_reference(*args, **kwargs)
365+
reference = property(_get_reference, set_reference, doc="Returns the Reference we point to") # type: ignore
366+
ref: Union['Head', 'TagReference', 'RemoteReference', 'Reference'] = reference # type: ignore
375367

376368
def is_valid(self) -> bool:
377369
"""

0 commit comments

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