Top Description Methods
org.eclipse.jgit.blame.cache

public Interface BlameCache

Imports
java.io.IOException, java.util.List, org.eclipse.jgit.lib.ObjectId, .Repository

Keeps the blame information for a path at certain commit.

If there is a result, it covers the whole file at that revision

Since
7.2

Method Summary

Modifier and TypeMethod and Description
public List<CacheRegion>

Returns:

the blame of a path at a given commit or null if not in cache
get
(Repository
repository containing the commit
repo
,
ObjectId
we are looking at the file in this revision
commitId
,
String
path a file in the repo
path
)

Gets the blame of a path at a given commit if available.

Method Detail

getback to summary
public List<CacheRegion> get(Repository repo, ObjectId commitId, String path) throws IOException

Gets the blame of a path at a given commit if available.

Since this cache is used in blame calculation, this get() method should only retrieve the cache value, and not re-trigger blame calculation. In other words, this acts as "getIfPresent", and not "computeIfAbsent".

Parameters
repo:Repository

repository containing the commit

commitId:ObjectId

we are looking at the file in this revision

path:String

path a file in the repo

Returns:List<CacheRegion>

the blame of a path at a given commit or null if not in cache

Exceptions
IOException:
error retrieving/parsing values from storage