MCPcopy Index your code
hub / github.com/saltstack/salt / _git_version

Function _git_version

tests/integration/modules/test_git.py:31–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29
30
31def _git_version():
32 git = shutil.which("git")
33 if not git:
34 log.debug("Git not installed")
35 return False
36 ret = subprocess.run(
37 ["git", "--version"],
38 stdout=subprocess.PIPE,
39 check=False,
40 shell=False,
41 text=True,
42 )
43 # On macOS, the git version is displayed in a different format
44 # git version 2.21.1 (Apple Git-122.3)
45 # As opposed to:
46 # git version 2.21.1
47 version_str = ret.stdout.strip().split("(")[0].strip().split()[-1]
48 git_version = LooseVersion(version_str)
49 log.debug("Detected git version: %s", git_version)
50 return git_version
51
52
53def _worktrees_supported():

Callers 2

_worktrees_supportedFunction · 0.70
test_worktree_add_rmMethod · 0.70

Calls 3

LooseVersionClass · 0.90
debugMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected