Merge "Add StoredValues.REPO_MANAGER"

This commit is contained in:
Chih-hung Hsieh 2018-10-31 23:52:15 +00:00 committed by Gerrit Code Review
commit fe7cb221ba

View File

@ -110,6 +110,18 @@ public final class StoredValues {
} }
}; };
// Accessing GitRepositoryManager could be slow.
// It should be minimized or cached to reduce pause time
// when evaluating Prolog submit rules.
public static final StoredValue<GitRepositoryManager> REPO_MANAGER =
new StoredValue<GitRepositoryManager>() {
@Override
public GitRepositoryManager createValue(Prolog engine) {
PrologEnvironment env = (PrologEnvironment) engine.control;
return env.getArgs().getGitRepositoryManager();
}
};
public static final StoredValue<Repository> REPOSITORY = public static final StoredValue<Repository> REPOSITORY =
new StoredValue<Repository>() { new StoredValue<Repository>() {
@Override @Override