Class ProjectGitController
java.lang.Object
ca.phon.app.project.git.ProjectGitController
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.jgit.dircache.DirCacheaddToIndex(String filepattern) Add files to current index.voidorg.eclipse.jgit.revwalk.RevCommitCommit changes to repository.org.eclipse.jgit.revwalk.RevCommitcommitAllChanges(String message) Commit all changes to repository.Get the folder for the git repository.booleanIs the project under git controlorg.eclipse.jgit.api.Gitinit()Setup a new git repository for the project.booleanisOpen()org.eclipse.jgit.api.Gitopen()Open existing repository for projectvoidprintStatus(Writer writer) org.eclipse.jgit.api.PullResultpull()Pull from repository.org.eclipse.jgit.api.PullResultPull from repositoryorg.eclipse.jgit.api.PullResultpull(org.eclipse.jgit.lib.ProgressMonitor monitor) Pull from repository.Iterable<org.eclipse.jgit.transport.PushResult> Push changesIterable<org.eclipse.jgit.transport.PushResult> push(org.eclipse.jgit.lib.ProgressMonitor monitor) voidorg.eclipse.jgit.api.Statusorg.eclipse.jgit.api.Statusstatus()Get status of repository.org.eclipse.jgit.api.Status
-
Constructor Details
-
ProjectGitController
-
-
Method Details
-
closeRepository
public void closeRepository() -
getProject
-
getRepositoryFolder
Get the folder for the git repository.- Returns:
- folder for git repository
-
hasGitFolder
public boolean hasGitFolder()Is the project under git control- Returns:
trueif the .git folder exists, false otherwise
-
init
public org.eclipse.jgit.api.Git init() throws IOException, IllegalStateException, org.eclipse.jgit.api.errors.GitAPIExceptionSetup a new git repository for the project.- Returns:
- the new git instance
- Throws:
org.eclipse.jgit.api.errors.GitAPIExceptionIllegalStateExceptionIOException
-
setupDefaultGitIgnore
- Throws:
IOException
-
open
Open existing repository for project- Returns:
- git instance
- Throws:
IOException
-
isOpen
public boolean isOpen() -
status
public org.eclipse.jgit.api.Status status() throws org.eclipse.jgit.errors.NoWorkTreeException, org.eclipse.jgit.api.errors.GitAPIExceptionGet status of repository.- Returns:
- repository status
- Throws:
org.eclipse.jgit.api.errors.GitAPIExceptionorg.eclipse.jgit.errors.NoWorkTreeException
-
status
public org.eclipse.jgit.api.Status status(String path) throws org.eclipse.jgit.errors.NoWorkTreeException, org.eclipse.jgit.api.errors.GitAPIException - Throws:
org.eclipse.jgit.errors.NoWorkTreeExceptionorg.eclipse.jgit.api.errors.GitAPIException
-
statis
public org.eclipse.jgit.api.Status statis(String... paths) throws org.eclipse.jgit.errors.NoWorkTreeException, org.eclipse.jgit.api.errors.GitAPIException - Throws:
org.eclipse.jgit.errors.NoWorkTreeExceptionorg.eclipse.jgit.api.errors.GitAPIException
-
printStatus
public void printStatus(Writer writer) throws IOException, org.eclipse.jgit.api.errors.GitAPIException - Throws:
IOExceptionorg.eclipse.jgit.api.errors.GitAPIException
-
addToIndex
public org.eclipse.jgit.dircache.DirCache addToIndex(String filepattern) throws org.eclipse.jgit.api.errors.NoFilepatternException, org.eclipse.jgit.api.errors.GitAPIException Add files to current index.- Parameters:
filepattern-- Throws:
org.eclipse.jgit.api.errors.GitAPIExceptionorg.eclipse.jgit.api.errors.NoFilepatternException
-
commit
public org.eclipse.jgit.revwalk.RevCommit commit(String message) throws org.eclipse.jgit.api.errors.NoHeadException, org.eclipse.jgit.api.errors.NoMessageException, org.eclipse.jgit.api.errors.UnmergedPathsException, org.eclipse.jgit.api.errors.ConcurrentRefUpdateException, org.eclipse.jgit.api.errors.WrongRepositoryStateException, org.eclipse.jgit.api.errors.AbortedByHookException, org.eclipse.jgit.api.errors.GitAPIException Commit changes to repository.- Parameters:
message-- Throws:
org.eclipse.jgit.api.errors.GitAPIExceptionorg.eclipse.jgit.api.errors.AbortedByHookExceptionorg.eclipse.jgit.api.errors.WrongRepositoryStateExceptionorg.eclipse.jgit.api.errors.ConcurrentRefUpdateExceptionorg.eclipse.jgit.api.errors.UnmergedPathsExceptionorg.eclipse.jgit.api.errors.NoMessageExceptionorg.eclipse.jgit.api.errors.NoHeadException
-
commitAllChanges
public org.eclipse.jgit.revwalk.RevCommit commitAllChanges(String message) throws org.eclipse.jgit.api.errors.NoHeadException, org.eclipse.jgit.api.errors.NoMessageException, org.eclipse.jgit.api.errors.UnmergedPathsException, org.eclipse.jgit.api.errors.ConcurrentRefUpdateException, org.eclipse.jgit.api.errors.WrongRepositoryStateException, org.eclipse.jgit.api.errors.AbortedByHookException, org.eclipse.jgit.api.errors.GitAPIException Commit all changes to repository.- Parameters:
message-- Returns:
- commit revision
- Throws:
org.eclipse.jgit.api.errors.NoHeadExceptionorg.eclipse.jgit.api.errors.NoMessageExceptionorg.eclipse.jgit.api.errors.UnmergedPathsExceptionorg.eclipse.jgit.api.errors.ConcurrentRefUpdateExceptionorg.eclipse.jgit.api.errors.WrongRepositoryStateExceptionorg.eclipse.jgit.api.errors.AbortedByHookExceptionorg.eclipse.jgit.api.errors.GitAPIException
-
pull
public org.eclipse.jgit.api.PullResult pull() throws org.eclipse.jgit.api.errors.WrongRepositoryStateException, org.eclipse.jgit.api.errors.InvalidConfigurationException, org.eclipse.jgit.api.errors.DetachedHeadException, org.eclipse.jgit.api.errors.InvalidRemoteException, org.eclipse.jgit.api.errors.CanceledException, org.eclipse.jgit.api.errors.RefNotFoundException, org.eclipse.jgit.api.errors.RefNotAdvertisedException, org.eclipse.jgit.api.errors.NoHeadException, org.eclipse.jgit.api.errors.TransportException, org.eclipse.jgit.api.errors.GitAPIExceptionPull from repository. This is the same as calling 'git pull' without args.- Returns:
- pull result
- Throws:
org.eclipse.jgit.api.errors.GitAPIExceptionorg.eclipse.jgit.api.errors.TransportExceptionorg.eclipse.jgit.api.errors.NoHeadExceptionorg.eclipse.jgit.api.errors.RefNotAdvertisedExceptionorg.eclipse.jgit.api.errors.RefNotFoundExceptionorg.eclipse.jgit.api.errors.CanceledExceptionorg.eclipse.jgit.api.errors.InvalidRemoteExceptionorg.eclipse.jgit.api.errors.DetachedHeadExceptionorg.eclipse.jgit.api.errors.InvalidConfigurationExceptionorg.eclipse.jgit.api.errors.WrongRepositoryStateException
-
pull
public org.eclipse.jgit.api.PullResult pull(org.eclipse.jgit.lib.ProgressMonitor monitor) throws org.eclipse.jgit.api.errors.WrongRepositoryStateException, org.eclipse.jgit.api.errors.InvalidConfigurationException, org.eclipse.jgit.api.errors.DetachedHeadException, org.eclipse.jgit.api.errors.InvalidRemoteException, org.eclipse.jgit.api.errors.CanceledException, org.eclipse.jgit.api.errors.RefNotFoundException, org.eclipse.jgit.api.errors.RefNotAdvertisedException, org.eclipse.jgit.api.errors.NoHeadException, org.eclipse.jgit.api.errors.TransportException, org.eclipse.jgit.api.errors.GitAPIException Pull from repository. This is the same as calling 'git pull' without args.- Parameters:
monitor-- Returns:
- pull result
- Throws:
org.eclipse.jgit.api.errors.GitAPIExceptionorg.eclipse.jgit.api.errors.TransportExceptionorg.eclipse.jgit.api.errors.NoHeadExceptionorg.eclipse.jgit.api.errors.RefNotAdvertisedExceptionorg.eclipse.jgit.api.errors.RefNotFoundExceptionorg.eclipse.jgit.api.errors.CanceledExceptionorg.eclipse.jgit.api.errors.InvalidRemoteExceptionorg.eclipse.jgit.api.errors.DetachedHeadExceptionorg.eclipse.jgit.api.errors.InvalidConfigurationExceptionorg.eclipse.jgit.api.errors.WrongRepositoryStateException
-
pull
public org.eclipse.jgit.api.PullResult pull(String remote, String branch, org.eclipse.jgit.lib.ProgressMonitor monitor) throws org.eclipse.jgit.api.errors.WrongRepositoryStateException, org.eclipse.jgit.api.errors.InvalidConfigurationException, org.eclipse.jgit.api.errors.DetachedHeadException, org.eclipse.jgit.api.errors.InvalidRemoteException, org.eclipse.jgit.api.errors.CanceledException, org.eclipse.jgit.api.errors.RefNotFoundException, org.eclipse.jgit.api.errors.RefNotAdvertisedException, org.eclipse.jgit.api.errors.NoHeadException, org.eclipse.jgit.api.errors.TransportException, org.eclipse.jgit.api.errors.GitAPIException Pull from repository- Parameters:
remote-branch-monitor-- Throws:
org.eclipse.jgit.api.errors.GitAPIExceptionorg.eclipse.jgit.api.errors.TransportExceptionorg.eclipse.jgit.api.errors.NoHeadExceptionorg.eclipse.jgit.api.errors.RefNotAdvertisedExceptionorg.eclipse.jgit.api.errors.RefNotFoundExceptionorg.eclipse.jgit.api.errors.CanceledExceptionorg.eclipse.jgit.api.errors.InvalidRemoteExceptionorg.eclipse.jgit.api.errors.DetachedHeadExceptionorg.eclipse.jgit.api.errors.InvalidConfigurationExceptionorg.eclipse.jgit.api.errors.WrongRepositoryStateException
-
push
public Iterable<org.eclipse.jgit.transport.PushResult> push(String remote, org.eclipse.jgit.lib.ProgressMonitor monitor) throws org.eclipse.jgit.api.errors.InvalidRemoteException, org.eclipse.jgit.api.errors.TransportException, org.eclipse.jgit.api.errors.GitAPIException Push changes- Parameters:
remote-monitor-- Throws:
org.eclipse.jgit.api.errors.GitAPIExceptionorg.eclipse.jgit.api.errors.TransportExceptionorg.eclipse.jgit.api.errors.InvalidRemoteException
-
push
public Iterable<org.eclipse.jgit.transport.PushResult> push(org.eclipse.jgit.lib.ProgressMonitor monitor) throws org.eclipse.jgit.api.errors.InvalidRemoteException, org.eclipse.jgit.api.errors.TransportException, org.eclipse.jgit.api.errors.GitAPIException - Throws:
org.eclipse.jgit.api.errors.InvalidRemoteExceptionorg.eclipse.jgit.api.errors.TransportExceptionorg.eclipse.jgit.api.errors.GitAPIException
-