From 521948989134c8e0ab7d4c1063780a0799f4dbc8 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Mon, 26 Feb 2024 20:58:21 -0500 Subject: [PATCH] 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. --- git/objects/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git/objects/base.py b/git/objects/base.py index 934fb40bc..938dd826c 100644 --- a/git/objects/base.py +++ b/git/objects/base.py @@ -226,7 +226,8 @@ def abspath(self) -> PathLike: Absolute path to this index object in the file system (as opposed to the :attr:`path` field which is a path relative to the git repository). - The returned path will be native to the system and contains '\' on Windows. + The returned path will be native to the system and contains ``\`` on + Windows. """ if self.repo.working_tree_dir is not None: return join_path_native(self.repo.working_tree_dir, self.path)