public class RestoreFileModification extends Object implements TreeModification
TreeModification
which restores a file. The file is added again if it was present
before the specified commit or deleted if it was absent.Constructor and Description |
---|
RestoreFileModification(String filePath) |
Modifier and Type | Method and Description |
---|---|
List<org.eclipse.jgit.dircache.DirCacheEditor.PathEdit> |
getPathEdits(org.eclipse.jgit.lib.Repository repository,
org.eclipse.jgit.revwalk.RevCommit baseCommit)
Returns a list of
PathEdit s which are necessary in order to achieve the desired
modification of the Git tree. |
public RestoreFileModification(String filePath)
public List<org.eclipse.jgit.dircache.DirCacheEditor.PathEdit> getPathEdits(org.eclipse.jgit.lib.Repository repository, org.eclipse.jgit.revwalk.RevCommit baseCommit) throws IOException
TreeModification
PathEdit
s which are necessary in order to achieve the desired
modification of the Git tree. The order of the PathEdit
s can be crucial and hence
shouldn't be changed.getPathEdits
in interface TreeModification
repository
- the affected Git repositorybaseCommit
- the commit to whose tree this modification is appliedPathEdit
sIOException
- if problems arise when accessing the repository