Class RenameFileModification

  • All Implemented Interfaces:
    TreeModification

    public class RenameFileModification
    extends Object
    implements TreeModification
    A TreeModification which renames a file or moves it to a different path.
    • Constructor Detail

      • RenameFileModification

        public RenameFileModification​(String currentFilePath,
                                      String newFilePath)
    • Method Detail

      • getPathEdits

        public List<org.eclipse.jgit.dircache.DirCacheEditor.PathEdit> getPathEdits​(org.eclipse.jgit.lib.Repository repository,
                                                                                    org.eclipse.jgit.revwalk.RevCommit baseCommit)
                                                                             throws IOException
        Description copied from interface: TreeModification
        Returns a list of PathEdits which are necessary in order to achieve the desired modification of the Git tree. The order of the PathEdits can be crucial and hence shouldn't be changed.
        Specified by:
        getPathEdits in interface TreeModification
        Parameters:
        repository - the affected Git repository
        baseCommit - 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

        public String getFilePath()
        Description copied from interface: TreeModification
        Indicates a file path which is affected by this TreeModification. 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 interface TreeModification
        Returns:
        an affected file path