From 7d96a1aefd13be6526c8deb8f66e92ba08133dff Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Fri, 23 Feb 2024 17:37:52 -0500 Subject: [PATCH 1/2] Fix ambiguous wording in Git.refresh docstring --- git/cmd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git/cmd.py b/git/cmd.py index 7625357e8..44dfadd13 100644 --- a/git/cmd.py +++ b/git/cmd.py @@ -397,7 +397,7 @@ def refresh(cls, path: Union[None, PathLike] = None) -> bool: 3. Pass a *path* argument. This path, if not absolute, it immediately resolved, relative to the current directory. This resolution occurs at the time of the refresh, and when git commands are run, they are run with - that actual path. If a *path* argument is passed, the + that previously resolved path. If a *path* argument is passed, the ``GIT_PYTHON_GIT_EXECUTABLE`` environment variable is not consulted. :note: Refreshing always sets the :attr:`Git.GIT_PYTHON_GIT_EXECUTABLE` class From b8ebff877b3bad8730366e7e0b9a28ac6c0bb183 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Fri, 23 Feb 2024 18:05:01 -0500 Subject: [PATCH 2/2] Suggest full-path refresh() in failure message This does not suggest or recommend *preferring* to explicitly call refresh() over the other other techniques, but it clarifies that the use of refresh() being presented needs a path argument. It also shows that path in the form of a full path, so users are less likely to be misled into thinking a command name or other relative path should be passed to refresh(), which should rarely be done (since refresh(path) resolves path). --- git/cmd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git/cmd.py b/git/cmd.py index 44dfadd13..5282acfdc 100644 --- a/git/cmd.py +++ b/git/cmd.py @@ -438,7 +438,7 @@ def refresh(cls, path: Union[None, PathLike] = None) -> bool: The git executable must be specified in one of the following ways: - be included in your $PATH - be set via $%s - - explicitly set via git.refresh() + - explicitly set via git.refresh("/full/path/to/git") """ ) % cls._git_exec_env_var