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.GitClient
Creates aGitClient
using 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.boolean
Returns 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
- theSCM
to 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:
true
if the working tree contains a valid repository,false
otherwise
-
createClient
public org.jenkinsci.plugins.gitclient.GitClient createClient()Creates aGitClient
using 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
-