Skip to content
Closed
18 changes: 11 additions & 7 deletions git/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,22 @@
def refresh(path: Optional[PathLike] = None) -> None:
"""Convenience method for setting the git executable path.

:param path: Optional path to the Git executable. If not absolute, it is resolved
:param path:
Optional path to the Git executable. If not absolute, it is resolved
immediately, relative to the current directory.

:note: The *path* parameter is usually omitted and cannot be used to specify a
custom command whose location is looked up in a path search on each call. See
:note:
The *path* parameter is usually omitted and cannot be used to specify a custom
command whose location is looked up in a path search on each call. See
:meth:`Git.refresh` for details on how to achieve this.

:note: This calls :meth:`Git.refresh` and sets other global configuration according
to the effect of doing so. As such, this function should usually be used instead
of using :meth:`Git.refresh` or :meth:`FetchInfo.refresh` directly.
:note:
This calls :meth:`Git.refresh` and sets other global configuration according to
the effect of doing so. As such, this function should usually be used instead of
using :meth:`Git.refresh` or :meth:`FetchInfo.refresh` directly.

:note: This function is called automatically, with no arguments, at import time.
:note:
This function is called automatically, with no arguments, at import time.
"""
global GIT_OK
GIT_OK = False
Expand Down
232 changes: 141 additions & 91 deletions git/cmd.py

Large diffs are not rendered by default.

15 changes: 9 additions & 6 deletions git/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
:attr:`sys.platform` checks explicitly, especially in cases where it matters which is
used.

:note: ``is_win`` is ``False`` on Cygwin, but is often wrongly assumed ``True``. To
detect Cygwin, use ``sys.platform == "cygwin"``.
:note:
``is_win`` is ``False`` on Cygwin, but is often wrongly assumed ``True``. To detect
Cygwin, use ``sys.platform == "cygwin"``.
"""

is_posix = os.name == "posix"
Expand All @@ -46,9 +47,10 @@
:attr:`sys.platform` checks explicitly, especially in cases where it matters which is
used.

:note: For POSIX systems, more detailed information is available in
:attr:`sys.platform`, while :attr:`os.name` is always ``"posix"`` on such systems,
including macOS (Darwin).
:note:
For POSIX systems, more detailed information is available in :attr:`sys.platform`,
while :attr:`os.name` is always ``"posix"`` on such systems, including macOS
(Darwin).
"""

is_darwin = sys.platform == "darwin"
Expand All @@ -57,7 +59,8 @@
This is deprecated because it clearer to write out :attr:`os.name` or
:attr:`sys.platform` checks explicitly.

:note: For macOS (Darwin), ``os.name == "posix"`` as in other Unix-like systems, while
:note:
For macOS (Darwin), ``os.name == "posix"`` as in other Unix-like systems, while
``sys.platform == "darwin"`.
"""

Expand Down
Loading