@@ -114,17 +114,18 @@ class Repo:
114114 'working_tree_dir' is the working tree directory, but will return None
115115 if we are a bare repository.
116116
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+ """
118119
119120 DAEMON_EXPORT_FILE = "git-daemon-export-ok"
120121
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__()`.
122123 working_dir : PathLike
123124 _working_tree_dir : Optional [PathLike ] = None
124125 git_dir : PathLike
125126 _common_dir : PathLike = ""
126127
127- # precompiled regex
128+ # Precompiled regex
128129 re_whitespace = re .compile (r"\s+" )
129130 re_hexsha_only = re .compile (r"^[0-9A-Fa-f]{40}$" )
130131 re_hexsha_shortened = re .compile (r"^[0-9A-Fa-f]{4,40}$" )
@@ -133,24 +134,32 @@ class Repo:
133134 re_tab_full_line = re .compile (r"^\t(.*)$" )
134135
135136 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:
138138 "--upload-pack" ,
139139 "-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:
143141 "--config" ,
144142 "-c" ,
145143 ]
144+ """Options to ``git clone`` that allow arbitrary commands to be executed.
146145
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
149156 config_level : ConfigLevels_Tup = ("system" , "user" , "global" , "repository" )
157+ """Represents the configuration level of a configuration file."""
150158
151159 # Subclass configuration
152- # Subclasses may easily bring in their own custom types by placing a constructor or type here
153160 GitCommandWrapperType = Git
161+ """Subclasses may easily bring in their own custom types by placing a constructor or
162+ type here."""
154163
155164 def __init__ (
156165 self ,
0 commit comments