@@ -63,7 +63,7 @@ class SymbolicReference:
63
63
This does not point to a specific commit, but to another
64
64
:class:`~git.refs.head.Head`, which itself specifies a commit.
65
65
66
- A typical example for a symbolic reference is `` HEAD` `.
66
+ A typical example for a symbolic reference is :class:`~git.refs.head. HEAD`.
67
67
"""
68
68
69
69
__slots__ = ("repo" , "path" )
@@ -115,8 +115,8 @@ def _get_packed_refs_path(cls, repo: "Repo") -> str:
115
115
116
116
@classmethod
117
117
def _iter_packed_refs (cls , repo : "Repo" ) -> Iterator [Tuple [str , str ]]:
118
- """Return an iterator yielding pairs of sha1/path pairs (as strings)
119
- for the corresponding refs.
118
+ """Return an iterator yielding pairs of sha1/path pairs (as strings) for the
119
+ corresponding refs.
120
120
121
121
:note:
122
122
The packed refs file will be kept open as long as we iterate.
@@ -226,9 +226,9 @@ def _get_ref_info_helper(
226
226
"""
227
227
:return:
228
228
(str(sha), str(target_ref_path)) if available, the sha the file at rela_path
229
- points to, or None.
229
+ points to, or `` None`` .
230
230
231
- target_ref_path is the reference we point to, or None.
231
+ target_ref_path is the reference we point to, or `` None`` .
232
232
"""
233
233
if ref_path :
234
234
cls ._check_ref_name_valid (ref_path )
@@ -273,7 +273,7 @@ def _get_ref_info(cls, repo: "Repo", ref_path: Union[PathLike, None]) -> Union[T
273
273
:return: (str(sha), str(target_ref_path)) if available, the sha the file at
274
274
rela_path points to, or None.
275
275
276
- target_ref_path is the reference we point to, or None.
276
+ target_ref_path is the reference we point to, or `` None`` .
277
277
"""
278
278
return cls ._get_ref_info_helper (repo , ref_path )
279
279
@@ -313,7 +313,7 @@ def set_commit(
313
313
:class:`~git.objects.commit.Commit`.
314
314
315
315
:raise ValueError:
316
- If `commit` is not a :class:`~git.objects.commit.Commit` object or doesn't
316
+ If `commit` is not a :class:`~git.objects.commit.Commit` object, nor does it
317
317
point to a commit.
318
318
319
319
:return:
@@ -357,7 +357,7 @@ def set_object(
357
357
to.
358
358
359
359
:param logmsg:
360
- If not None, the message will be used in the reflog entry to be written.
360
+ If not `` None`` , the message will be used in the reflog entry to be written.
361
361
Otherwise the reflog is not altered.
362
362
363
363
:note:
@@ -491,8 +491,8 @@ def set_reference(
491
491
def is_valid (self ) -> bool :
492
492
"""
493
493
:return:
494
- True if the reference is valid, hence it can be read and points to a valid
495
- object or reference.
494
+ `` True`` if the reference is valid, hence it can be read and points to a
495
+ valid object or reference.
496
496
"""
497
497
try :
498
498
self .object
@@ -505,7 +505,7 @@ def is_valid(self) -> bool:
505
505
def is_detached (self ) -> bool :
506
506
"""
507
507
:return:
508
- True if we are a detached reference, hence we point to a specific commit
508
+ `` True`` if we are a detached reference, hence we point to a specific commit
509
509
instead to another reference.
510
510
"""
511
511
try :
@@ -565,7 +565,7 @@ def log_append(
565
565
def log_entry (self , index : int ) -> "RefLogEntry" :
566
566
"""
567
567
:return:
568
- RefLogEntry at the given index
568
+ :class:`~git.refs.log. RefLogEntry` at the given index
569
569
570
570
:param index:
571
571
Python list compatible positive or negative index.
@@ -582,7 +582,7 @@ def to_full_path(cls, path: Union[PathLike, "SymbolicReference"]) -> PathLike:
582
582
"""
583
583
:return:
584
584
String with a full repository-relative path which can be used to initialize
585
- a Reference instance, for instance by using
585
+ a :class:`~git.refs.reference. Reference` instance, for instance by using
586
586
:meth:`Reference.from_path <git.refs.reference.Reference.from_path>`.
587
587
"""
588
588
if isinstance (path , SymbolicReference ):
@@ -666,7 +666,7 @@ def _create(
666
666
) -> T_References :
667
667
"""Internal method used to create a new symbolic reference.
668
668
669
- If `resolve` is False, the reference will be taken as is, creating a proper
669
+ If `resolve` is `` False`` , the reference will be taken as is, creating a proper
670
670
symbolic reference. Otherwise it will be resolved to the corresponding object
671
671
and a detached symbolic reference will be created instead.
672
672
"""
@@ -722,12 +722,12 @@ def create(
722
722
If it is a commit-ish, the symbolic ref will be detached.
723
723
724
724
:param force:
725
- If True, force creation even if a symbolic reference with that name already
726
- exists. Raise :class:`OSError` otherwise.
725
+ If `` True`` , force creation even if a symbolic reference with that name
726
+ already exists. Raise :class:`OSError` otherwise.
727
727
728
728
:param logmsg:
729
- If not None, the message to append to the reflog.
730
- If None, no reflog entry is written.
729
+ If not `` None`` , the message to append to the reflog.
730
+ If `` None`` , no reflog entry is written.
731
731
732
732
:return:
733
733
Newly created symbolic reference
@@ -751,8 +751,8 @@ def rename(self, new_path: PathLike, force: bool = False) -> "SymbolicReference"
751
751
In case this is a symbolic ref, there is no implied prefix.
752
752
753
753
:param force:
754
- If True, the rename will succeed even if a head with the target name already
755
- exists. It will be overwritten in that case.
754
+ If `` True`` , the rename will succeed even if a head with the target name
755
+ already exists. It will be overwritten in that case.
756
756
757
757
:return:
758
758
self
@@ -847,8 +847,8 @@ def iter_items(
847
847
:param common_path:
848
848
Optional keyword argument to the path which is to be shared by all returned
849
849
Ref objects.
850
- Defaults to class specific portion if None, ensuring that only refs suitable
851
- for the actual class are returned.
850
+ Defaults to class specific portion if `` None`` , ensuring that only refs
851
+ suitable for the actual class are returned.
852
852
853
853
:return:
854
854
A list of :class:`SymbolicReference`, each guaranteed to be a symbolic ref
0 commit comments