Class GitRepositoryValidator
java.lang.Object
io.jenkins.plugins.forensics.git.util.GitRepositoryValidator
Inspects a given working tree and determines if this path is a valid Git repository that can be used to run one of
the forensics analyzers.
- Author:
- Ullrich Hafner
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGitRepositoryValidator(SCM scm, Run<?, ?> build, FilePath workTree, TaskListener listener, edu.hm.hafner.util.FilteredLog logger) Creates a newGitRepositoryValidator. -
Method Summary
Modifier and TypeMethodDescriptionorg.jenkinsci.plugins.gitclient.GitClientCreates aGitClientusing the field values.getHead()Returns the GIT_COMMIT environment variable, or 'HEAD' if not set.getId()Returns the key for the associated SCM.getScm()Returns the associated SCM.booleanReturns whether the specified working tree contains a valid Git repository that can be used to run one of the forensics analyzers.
-
Field Details
-
INFO_SHALLOW_CLONE
Error message.- See Also:
-
-
Constructor Details
-
GitRepositoryValidator
public GitRepositoryValidator(SCM scm, Run<?, ?> build, FilePath workTree, TaskListener listener, edu.hm.hafner.util.FilteredLog logger) Creates a newGitRepositoryValidator.- Parameters:
scm- theSCMto create the blamer forbuild- the current buildworkTree- the working tree to inspectlistener- a task listenerlogger- a logger to report error messages
-
-
Method Details
-
isGitRepository
public boolean isGitRepository()Returns whether the specified working tree contains a valid Git repository that can be used to run one of the forensics analyzers.- Returns:
trueif the working tree contains a valid repository,falseotherwise
-
createClient
public org.jenkinsci.plugins.gitclient.GitClient createClient()Creates aGitClientusing the field values.- Returns:
- a
GitClient
-
getHead
Returns the GIT_COMMIT environment variable, or 'HEAD' if not set.- Returns:
- a
GitClient
-
getId
Returns the key for the associated SCM.- Returns:
- the SCM key
-
getScm
Returns the associated SCM.- Returns:
- the SCM
-