Class FileDiffCacheImpl

  • All Implemented Interfaces:
    FileDiffCache

    public class FileDiffCacheImpl
    extends Object
    implements FileDiffCache
    Cache for the single file diff between two commits for a single file path. This cache adds extra Gerrit logic such as identifying edits due to rebase.

    If the FileDiffCacheKey.oldCommit() is equal to Constants.EMPTY_TREE_ID, the git diff will be evaluated against the empty tree.

    • Method Detail

      • module

        public static com.google.inject.Module module()
      • get

        public FileDiffOutput get​(FileDiffCacheKey key)
                           throws DiffNotAvailableException
        Description copied from interface: FileDiffCache
        Returns the file diff for a single file path identified by its key.
        Specified by:
        get in interface FileDiffCache
        Parameters:
        key - identifies two git commits, a specific file path and other diff parameters.
        Returns:
        the file diff for a single file path identified by its key.
        Throws:
        DiffNotAvailableException - if the commit IDs of the key are invalid for this project or if file contents could not be read.