Defer checking git version until it is needed
Review Request #7405 — Created June 11, 2015 and submitted
Previously, the
gi
t version was checked in the initialization of the
GitClient
SCM Client. However, with systems that do not havegit
installed, this would result in an error being printed thatgit
could
not be found. We now defer determining the installedgit
version
until we need it, which occurs after we are sure thatgit
is
installed.
Ran unit tests.
Removed
git
from my system and ranrbt status
. Without this patch,
an error message was printed. With it applied, there was no error.
-
-
rbtools/clients/git.py (Diff revision 1) If
m
isNone
, we end up going through all this logic every time we call this function. We should just default_git_version
toNone
, instead of in theelse
, and then we're good. -
rbtools/clients/git.py (Diff revision 1) We can probably just set
_git_version
to this, reducing the calculations needed when returning.
Change Summary:
Address Christian's issues.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+22 -13) |
-
Tool: Pyflakes Processed Files: rbtools/clients/git.py Tool: PEP8 Style Checker Processed Files: rbtools/clients/git.py