Class GitRepository
- java.lang.Object
-
- org.jboss.as.server.controller.git.GitRepository
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class GitRepository extends Object implements Closeable
Abstraction over a git repository.- Author:
- Emmanuel Hugonnet (c) 2017 Red Hat, inc.
-
-
Constructor Summary
Constructors Constructor Description GitRepository(org.eclipse.jgit.lib.Repository repository)GitRepository(GitRepositoryConfiguration gitConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidcommit(String msg)Commit all changes if there are uncommitted changes.StringgetBranch()FilegetDirectory()org.eclipse.jgit.api.GitgetGit()StringgetPattern(File file)StringgetPattern(Path file)StringgetRemoteName(String gitRepository)booleanisBare()booleanisValidRemoteName(String remoteName)voidrollback()Reset hard on HEAD.
-
-
-
Constructor Detail
-
GitRepository
public GitRepository(GitRepositoryConfiguration gitConfig) throws IllegalArgumentException, IOException, org.wildfly.client.config.ConfigXMLParseException, GeneralSecurityException
- Throws:
IllegalArgumentExceptionIOExceptionorg.wildfly.client.config.ConfigXMLParseExceptionGeneralSecurityException
-
GitRepository
public GitRepository(org.eclipse.jgit.lib.Repository repository)
-
-
Method Detail
-
getGit
public org.eclipse.jgit.api.Git getGit()
-
getDirectory
public File getDirectory()
-
isBare
public boolean isBare()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getBranch
public String getBranch()
-
isValidRemoteName
public final boolean isValidRemoteName(String remoteName)
-
rollback
public void rollback() throws org.eclipse.jgit.api.errors.GitAPIExceptionReset hard on HEAD.- Throws:
org.eclipse.jgit.api.errors.GitAPIException
-
commit
public void commit(String msg) throws org.eclipse.jgit.api.errors.GitAPIException
Commit all changes if there are uncommitted changes.- Parameters:
msg- the commit message.- Throws:
org.eclipse.jgit.api.errors.GitAPIException
-
-