MCPcopy
hub / github.com/git-lfs/git-lfs / IsGitVersionAtLeast

Function IsGitVersionAtLeast

git/version.go:28–35  ·  view source on GitHub ↗

IsVersionAtLeast returns whether the git version is the one specified or higher argument is plain version string separated by '.' e.g. "2.3.1" but can omit minor/patch

(ver string)

Source from the content-addressed store, hash-verified

26// IsVersionAtLeast returns whether the git version is the one specified or higher
27// argument is plain version string separated by '.' e.g. "2.3.1" but can omit minor/patch
28func IsGitVersionAtLeast(ver string) bool {
29 gitver, err := Version()
30 if err != nil {
31 tracerx.Printf("Error getting git version: %v", err)
32 return false
33 }
34 return IsVersionAtLeast(gitver, ver)
35}
36
37// IsVersionAtLeast compares 2 version strings (ok to be prefixed with 'git version', ignores)
38func IsVersionAtLeast(actualVersion, desiredVersion string) bool {

Callers 15

runScanLFSFilesFunction · 0.92
initFunction · 0.92
requireGitVersionFunction · 0.92
cloneCommandFunction · 0.92
postCloneSubmodulesFunction · 0.92
initFunction · 0.92
filterCommandFunction · 0.92
updateRefsMethod · 0.92
HookDirMethod · 0.92
GetSystemAttributePathsFunction · 0.85
gitConfigNoLFSFunction · 0.85
GitCommonDirFunction · 0.85

Calls 2

VersionFunction · 0.85
IsVersionAtLeastFunction · 0.85

Tested by 2

TestWorktreesFunction · 0.68
TestWorktreesBareRepoFunction · 0.68