Skip to content

Commit 4f67369

Browse files
committed
Fix backslashes in Repo.__init__ docstring
The example code block included a Windows-style path string written with doubled backslashes, but the docstring itself was not a raw string literal, so these collapsed into single backslashes. This makes the whole docstring an R-string, which is sufficient to solve that problem (since the backslashes are in a code block, Sphinx does not itself treat them as metacharacters). In addition, this changes the Windows-style path to be an R-string rather than using doubled backslashes. This is just to improve clarity (and remind readers they can use an R-string for Windows paths), and does not affect correctness.
1 parent d1d18c2 commit 4f67369

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: git/repo/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def __init__(
168168
search_parent_directories: bool = False,
169169
expand_vars: bool = True,
170170
) -> None:
171-
"""Create a new Repo instance.
171+
R"""Create a new Repo instance.
172172
173173
:param path:
174174
The path to either the root git directory or the bare git repo::
@@ -177,7 +177,7 @@ def __init__(
177177
repo = Repo("/Users/mtrier/Development/git-python.git")
178178
repo = Repo("~/Development/git-python.git")
179179
repo = Repo("$REPOSITORIES/Development/git-python.git")
180-
repo = Repo("C:\\Users\\mtrier\\Development\\git-python\\.git")
180+
repo = Repo(R"C:\Users\mtrier\Development\git-python\.git")
181181
182182
- In *Cygwin*, path may be a ``cygdrive/...`` prefixed path.
183183
- If it evaluates to false, :envvar:`GIT_DIR` is used, and if this also

0 commit comments

Comments
 (0)