Convert constant and attribute comments to docstrings · EliahKagan/GitPython@94a85d1 (original) (raw)
`@@ -114,17 +114,18 @@ class Repo:
`
114
114
` 'working_tree_dir' is the working tree directory, but will return None
`
115
115
` if we are a bare repository.
`
116
116
``
117
``
`-
'git_dir' is the .git repository directory, which is always set."""
`
``
117
`+
'git_dir' is the .git repository directory, which is always set.
`
``
118
`+
"""
`
118
119
``
119
120
`DAEMON_EXPORT_FILE = "git-daemon-export-ok"
`
120
121
``
121
``
`` -
git = cast("Git", None) # Must exist, or del will fail in case we raise on __init__()
``
``
122
`` +
git = cast("Git", None) # Must exist, or del will fail in case we raise on __init__()
.
``
122
123
`working_dir: PathLike
`
123
124
`_working_tree_dir: Optional[PathLike] = None
`
124
125
`git_dir: PathLike
`
125
126
`_common_dir: PathLike = ""
`
126
127
``
127
``
`-
precompiled regex
`
``
128
`+
Precompiled regex
`
128
129
`re_whitespace = re.compile(r"\s+")
`
129
130
`re_hexsha_only = re.compile(r"^[0-9A-Fa-f]{40}$")
`
130
131
`re_hexsha_shortened = re.compile(r"^[0-9A-Fa-f]{4,40}$")
`
`@@ -133,24 +134,32 @@ class Repo:
`
133
134
`re_tab_full_line = re.compile(r"^\t(.*)$")
`
134
135
``
135
136
`unsafe_git_clone_options = [
`
136
``
`-
This option allows users to execute arbitrary commands.
`
137
``
`-
https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---upload-packltupload-packgt
`
``
137
`+
Executes arbitrary commands:
`
138
138
`"--upload-pack",
`
139
139
`"-u",
`
140
``
`-
Users can override configuration variables
`
141
``
`` -
like protocol.allow
or core.gitProxy
to execute arbitrary commands.
``
142
``
`-
https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---configltkeygtltvaluegt
`
``
140
`+
Can override configuration variables that execute arbitrary commands:
`
143
141
`"--config",
`
144
142
`"-c",
`
145
143
` ]
`
``
144
"""Options to ``git clone`` that allow arbitrary commands to be executed.
146
145
``
147
``
`-
invariants
`
148
``
`-
represents the configuration level of a configuration file
`
``
146
The ``--upload-pack``/``-u`` option allows users to execute arbitrary commands
``
147
`+
directly:
`
``
148
`+
https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---upload-packltupload-packgt
`
``
149
+
``
150
The ``--config``/``-c`` option allows users to override configuration variables like
``
151
``protocol.allow`` and ``core.gitProxy`` to execute arbitrary commands:
``
152
`+
https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---configltkeygtltvaluegt
`
``
153
`+
"""
`
``
154
+
``
155
`+
Invariants
`
149
156
`config_level: ConfigLevels_Tup = ("system", "user", "global", "repository")
`
``
157
`+
"""Represents the configuration level of a configuration file."""
`
150
158
``
151
159
`# Subclass configuration
`
152
``
`-
Subclasses may easily bring in their own custom types by placing a constructor or type here
`
153
160
`GitCommandWrapperType = Git
`
``
161
`+
"""Subclasses may easily bring in their own custom types by placing a constructor or
`
``
162
`+
type here."""
`
154
163
``
155
164
`def init(
`
156
165
`self,
`