Content-Length: 269047 | pFad | http://github.com/gitpython-developers/GitPython/commit/e80fc5f841c64cc3ec88c97d8ae22f82295f46e7

14 Clarify why an initial failing git command can be set · gitpython-developers/GitPython@e80fc5f · GitHub
Skip to content

Commit e80fc5f

Browse files
committed
Clarify why an initial failing git command can be set
This clarifies the comment that explains the significance of setting the Git.GIT_PYTHON_GIT_EXECUTABLE attribute when running it did not suceeed but it hadn't been set before (or was set to None). This happens in the code path in Git.refresh where has_git is False and old_git is None, provided the refresh mode doesn't call for the initial refresh to raise an exception on failure. It was previously described in terms of a "first" and "second" import, but as discussed in #1804, the rationale and effect were not altogether clear.
1 parent d28c20b commit e80fc5f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

git/cmd.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,10 @@ def refresh(cls, path: Union[None, PathLike] = None) -> bool:
475475
)
476476
raise ImportError(err)
477477

478-
# We get here if this was the init refresh and the refresh mode was not
479-
# error. Go ahead and set the GIT_PYTHON_GIT_EXECUTABLE such that we
480-
# discern the difference between a first import and a second import.
478+
# We get here if this was the initial refresh and the refresh mode was
479+
# not error. Go ahead and set the GIT_PYTHON_GIT_EXECUTABLE such that we
480+
# discern the the difference between the first refresh at import time
481+
# and subsequent calls to refresh.
481482
cls.GIT_PYTHON_GIT_EXECUTABLE = cls.git_exec_name
482483
else:
483484
# After the first refresh (when GIT_PYTHON_GIT_EXECUTABLE is no longer

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/gitpython-developers/GitPython/commit/e80fc5f841c64cc3ec88c97d8ae22f82295f46e7

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy