Class ModifiedFilesLoader
Rename detection is off unless withRenameDetection(int) is called.
The commits and their trees are looked up via the RevWalk instance that is provided to
the load(com.google.gerrit.entities.Project.NameKey, Config, RevWalk, ObjectId, ObjectId) method, unless the modified files for the trees of the commits should be retrieved
from the GitModifiedFilesCache (see ModifiedFilesLoader.Factory.createWithRetrievingModifiedFilesForTreesFromGitModifiedFilesCache() in which case the
trees are looked up via a new RevWalk instance that is created by
GitModifiedFilesCacheImpl.Loader. Looking up the trees from a new RevWalk instance only
succeeds if they were already fully persisted in the repository, i.e., if these are not newly
created trees or tree which have been created in memory. This means using the GitModifiedFilesCache is expected to cause MissingObjectExceptions for the commit trees
that are newly created or that were created in memory only.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableList<ModifiedFile> load(Project.NameKey project, org.eclipse.jgit.lib.Config repoConfig, org.eclipse.jgit.revwalk.RevWalk revWalk, org.eclipse.jgit.lib.ObjectId baseCommit, org.eclipse.jgit.lib.ObjectId newCommit) Loads the files that have been modified betweenbaseCommitandnewCommit.withRenameDetection(int renameScore) Enables rename detection
-
Method Details
-
withRenameDetection
Enables rename detection- Parameters:
renameScore- the score that should be used for the rename detection.
-
load
public com.google.common.collect.ImmutableList<ModifiedFile> load(Project.NameKey project, org.eclipse.jgit.lib.Config repoConfig, org.eclipse.jgit.revwalk.RevWalk revWalk, org.eclipse.jgit.lib.ObjectId baseCommit, org.eclipse.jgit.lib.ObjectId newCommit) throws DiffNotAvailableException Loads the files that have been modified betweenbaseCommitandnewCommit.The commits and the commit trees are looked up via the given
revWalkinstance, unless the modified files for the trees of the commits should be retrieved from theGitModifiedFilesCache(seeModifiedFilesLoader.Factory.createWithRetrievingModifiedFilesForTreesFromGitModifiedFilesCache()in which case the trees are looked up via a newRevWalkinstance that is created byGitModifiedFilesCacheImpl.Loader. Also see the javadoc on this class.- Throws:
DiffNotAvailableException
-