Class ChangeFileContentModification
- java.lang.Object
-
- com.google.gerrit.server.edit.tree.ChangeFileContentModification
-
- All Implemented Interfaces:
TreeModification
public class ChangeFileContentModification extends Object implements TreeModification
ATreeModification
which changes the content of a file.
-
-
Constructor Summary
Constructors Constructor Description ChangeFileContentModification(String filePath, RawInput newContent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getFilePath()
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 ofPathEdit
s which are necessary in order to achieve the desired modification of the Git tree.
-
-
-
Method Detail
-
getPathEdits
public List<org.eclipse.jgit.dircache.DirCacheEditor.PathEdit> getPathEdits(org.eclipse.jgit.lib.Repository repository, org.eclipse.jgit.revwalk.RevCommit baseCommit)
Description copied from interface:TreeModification
Returns a list ofPathEdit
s which are necessary in order to achieve the desired modification of the Git tree. The order of thePathEdit
s can be crucial and hence shouldn't be changed.- Specified by:
getPathEdits
in interfaceTreeModification
- Parameters:
repository
- the affected Git repositorybaseCommit
- the commit to whose tree this modification is applied- Returns:
- an ordered list of necessary
PathEdit
s
-
getFilePath
public String getFilePath()
Description copied from interface:TreeModification
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.- Specified by:
getFilePath
in interfaceTreeModification
- Returns:
- an affected file path
-
-