Skip to content

Commit

Permalink
Somewhat improve _get_ref_info{,_helper} docstrings
Browse files Browse the repository at this point in the history
+ Add a missing :class: reference in _get_commit docstring.
  • Loading branch information
EliahKagan committed Feb 29, 2024
1 parent 63983c2 commit f43292e
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions git/refs/symbolic.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ def _get_ref_info_helper(
) -> Union[Tuple[str, None], Tuple[None, str]]:
"""
:return:
(str(sha), str(target_ref_path)) if available, the sha the file at rela_path
points to, or ``None``.
*(str(sha), str(target_ref_path))*, where:
target_ref_path is the reference we point to, or ``None``.
* *sha* is of the file at rela_path points to if available, or ``None``.
* *target_ref_path* is the reference we point to, or ``None``.
"""
if ref_path:
cls._check_ref_name_valid(ref_path)
Expand Down Expand Up @@ -270,10 +270,11 @@ def _get_ref_info_helper(
@classmethod
def _get_ref_info(cls, repo: "Repo", ref_path: Union[PathLike, None]) -> Union[Tuple[str, None], Tuple[None, str]]:
"""
:return: (str(sha), str(target_ref_path)) if available, the sha the file at
rela_path points to, or None.
:return:
*(str(sha), str(target_ref_path))*, where:
target_ref_path is the reference we point to, or ``None``.
* *sha* is of the file at rela_path points to if available, or ``None``.
* *target_ref_path* is the reference we point to, or ``None``.
"""
return cls._get_ref_info_helper(repo, ref_path)

Expand All @@ -290,9 +291,9 @@ def _get_object(self) -> Commit_ish:
def _get_commit(self) -> "Commit":
"""
:return:
Commit object we point to. This works for detached and non-detached
:class:`SymbolicReference` instances. The symbolic reference will be
dereferenced recursively.
:class:`~git.objects.commit.Commit` object we point to. This works for
detached and non-detached :class:`SymbolicReference` instances. The symbolic
reference will be dereferenced recursively.
"""
obj = self._get_object()
if obj.type == "tag":
Expand Down

0 comments on commit f43292e

Please sign in to comment.