Skip to content

Commit 5219489

Browse files
committedFeb 27, 2024
Fix IndexObject.abspath docstring formatting
The original problem where the backslash wasn't included in the docstring at all was fixed in 7dd2095 (#1725), but the backslash still did not appear in rendered Sphinx documentation, because it was also treated as a reStructuredText metacharacter. Although that can be addressed by adding a further backslash to escape it, the effect is ambiguous when the docstring is read in the code. So this just encloses it in a double-backticked code span instead, which is a somewhat clearer way to show it anyway.
1 parent 115451d commit 5219489

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎git/objects/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ def abspath(self) -> PathLike:
226226
Absolute path to this index object in the file system (as opposed to the
227227
:attr:`path` field which is a path relative to the git repository).
228228
229-
The returned path will be native to the system and contains '\' on Windows.
229+
The returned path will be native to the system and contains ``\`` on
230+
Windows.
230231
"""
231232
if self.repo.working_tree_dir is not None:
232233
return join_path_native(self.repo.working_tree_dir, self.path)

0 commit comments

Comments
 (0)
Please sign in to comment.