Interface TreeModification
-
- All Known Implementing Classes:
ChangeFileContentModification,DeleteFileModification,RenameFileModification,RestoreFileModification
public interface TreeModificationA specific modification of a Git tree.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetFilePath()Indicates a file path which is affected by thisTreeModification.List<org.eclipse.jgit.dircache.DirCacheEditor.PathEdit>getPathEdits(org.eclipse.jgit.lib.Repository repository, org.eclipse.jgit.revwalk.RevCommit baseCommit)Returns a list ofPathEdits which are necessary in order to achieve the desired modification of the Git tree.
-
-
-
Method Detail
-
getPathEdits
List<org.eclipse.jgit.dircache.DirCacheEditor.PathEdit> getPathEdits(org.eclipse.jgit.lib.Repository repository, org.eclipse.jgit.revwalk.RevCommit baseCommit) throws IOException
Returns a list ofPathEdits which are necessary in order to achieve the desired modification of the Git tree. The order of thePathEdits can be crucial and hence shouldn't be changed.- Parameters:
repository- the affected Git repositorybaseCommit- the commit to whose tree this modification is applied- Returns:
- an ordered list of necessary
PathEdits - Throws:
IOException- if problems arise when accessing the repository
-
getFilePath
String getFilePath()
Indicates a file path which is affected by thisTreeModification. If the modification refers to several file paths (e.g. renaming a file), returning either of them is appropriate as long as the returned value is deterministic.- Returns:
- an affected file path
-
-