Use exactRef() when possible
This avoids ambiguous lookups when refs/heads/refs/meta/config exists. Instead only refs/meta/config or nothing is returned. exactRef() can also be optimized by JGit implementations to lookup a ref, potentially saving time by avoiding unnecessary reads of the storage system. Change-Id: I1fd6750e7dce935597cf46331fe7cb6dc21473bb
This commit is contained in:
@@ -96,7 +96,7 @@ public abstract class VersionedMetaData {
|
||||
* @throws ConfigInvalidException
|
||||
*/
|
||||
public void load(Repository db) throws IOException, ConfigInvalidException {
|
||||
Ref ref = db.getRef(getRefName());
|
||||
Ref ref = db.getRefDatabase().exactRef(getRefName());
|
||||
load(db, ref != null ? ref.getObjectId() : null);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user