Class GitScmTestUtils
- java.lang.Object
- 
- org.apache.maven.scm.provider.git.GitScmTestUtils
 
- 
 public final class GitScmTestUtils extends Object - Author:
- Trygve Laugstøl
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringGIT_COMMAND_LINE'git' command line.
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddeleteAllDirectories(File startDirectory, String pattern)static StringgetScmUrl(File repositoryRootFile, String provider)static voidinitRepo(File repository, File workingDirectory, File assertionDirectory)static voidinitRepo(String source, File repository, File workingDirectory)static voidsetDefaultGitConfig(File repositoryRootFile)static voidsetDefaultGitConfig(File repositoryRootFile, Consumer<FileWriter> configWriterCustomizer)static voidsetupRejectAllCommitsPreCommitHook(File workspaceRoot)static voidsetupRejectAllCommitsPrePushHook(File workspaceRoot)Sets up a pre-push git hook that rejects all commits for the given repository (client-side).static voidsetupRejectAllCommitsPreReceiveHook(File repositoryRootFile)Sets up a pre-receive git hook that rejects all commits for the given repository (server-side).
 
- 
- 
- 
Field Detail- 
GIT_COMMAND_LINEpublic static final String GIT_COMMAND_LINE 'git' command line.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
initRepopublic static void initRepo(File repository, File workingDirectory, File assertionDirectory) throws IOException - Throws:
- IOException
 
 - 
initRepopublic static void initRepo(String source, File repository, File workingDirectory) throws IOException - Throws:
- IOException
 
 - 
getScmUrlpublic static String getScmUrl(File repositoryRootFile, String provider) throws org.codehaus.plexus.util.cli.CommandLineException - Throws:
- org.codehaus.plexus.util.cli.CommandLineException
 
 - 
deleteAllDirectoriespublic static void deleteAllDirectories(File startDirectory, String pattern) throws IOException - Throws:
- IOException
 
 - 
setDefaultGitConfigpublic static void setDefaultGitConfig(File repositoryRootFile) throws IOException - Throws:
- IOException
 
 - 
setDefaultGitConfigpublic static void setDefaultGitConfig(File repositoryRootFile, Consumer<FileWriter> configWriterCustomizer) throws IOException - Throws:
- IOException
 
 - 
setupRejectAllCommitsPreReceiveHookpublic static void setupRejectAllCommitsPreReceiveHook(File repositoryRootFile) throws IOException Sets up a pre-receive git hook that rejects all commits for the given repository (server-side). This is useful for testing scenarios where you want to simulate a repository that doesn't allow any new commits. This hook is not supported by JGit.- Parameters:
- repositoryRootFile- the root directory of the git repository
- Throws:
- IOException- if there's an error creating or writing the hook file
 
 - 
setupRejectAllCommitsPrePushHookpublic static void setupRejectAllCommitsPrePushHook(File workspaceRoot) throws IOException Sets up a pre-push git hook that rejects all commits for the given repository (client-side). This is useful for testing scenarios where you want to simulate a repository that doesn't allow any new commits.- Parameters:
- workspaceRoot- the root directory of the git working copy
- Throws:
- IOException- if there's an error creating or writing the hook file
 
 - 
setupRejectAllCommitsPreCommitHookpublic static void setupRejectAllCommitsPreCommitHook(File workspaceRoot) throws IOException - Throws:
- IOException
 
 
- 
 
-