Movatterモバイル変換


[0]ホーム

URL:


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

Fix type hint forSymbolicReference.reference property#2074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Byron merged 1 commit intogitpython-developers:mainfromemmanuel-ferdman:main
Sep 30, 2025
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletionsgit/refs/symbolic.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,6 +40,7 @@
from git.config import GitConfigParser
from git.objects.commit import Actor
from git.refs.log import RefLogEntry
from git.refs.reference import Reference
from git.repo import Repo


Expand DownExpand Up@@ -404,7 +405,7 @@ def object(self) -> AnyGitObject:
def object(self, object: Union[AnyGitObject, "SymbolicReference", str]) -> "SymbolicReference":
return self.set_object(object)

def _get_reference(self) -> "SymbolicReference":
def _get_reference(self) -> "Reference":
"""
:return:
:class:`~git.refs.reference.Reference` object we point to
Expand All@@ -416,7 +417,7 @@ def _get_reference(self) -> "SymbolicReference":
sha, target_ref_path = self._get_ref_info(self.repo, self.path)
if target_ref_path is None:
raise TypeError("%s is a detached symbolic reference as it points to %r" % (self, sha))
return self.from_path(self.repo, target_ref_path)
returncast("Reference",self.from_path(self.repo, target_ref_path))

def set_reference(
self,
Expand DownExpand Up@@ -502,7 +503,7 @@ def set_reference(

# Aliased reference
@property
def reference(self) -> "SymbolicReference":
def reference(self) -> "Reference":
return self._get_reference()

@reference.setter
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp