Class GitDiscovery
java.lang.Object
io.github.jbastgen.stemma.git.cli.GitDiscovery
Finds and validates git installations: on the
PATH, in well-known locations per operating system, and
at a location chosen by the user (an installation directory or the executable itself).-
Constructor Summary
ConstructorsConstructorDescriptionLooks at the real system: its operating system, environment and home folder. -
Method Summary
Modifier and TypeMethodDescriptiondiscover()All usable git installations found on this machine, in order of preference:PATHentries first, then well-known locations.findBest()The preferred installation: the first supported one, or empty if there is none.Runsgit --versionon one executable and validates the answer.Resolves a location chosen by the user: either the git executable or an installation directory.
-
Constructor Details
-
GitDiscovery
public GitDiscovery()Looks at the real system: its operating system, environment and home folder.
-
-
Method Details
-
discover
All usable git installations found on this machine, in order of preference:PATHentries first, then well-known locations. The same executable (also via symlink) is listed once. -
findBest
The preferred installation: the first supported one, or empty if there is none. -
resolve
Resolves a location chosen by the user: either the git executable or an installation directory. For a directory the usual layouts are tried (cmd/git.exeandbin/git.exeof Git for Windows,bin/gitof Unix installations, or the executable directly inside the directory). -
probe
Runsgit --versionon one executable and validates the answer.
-