use of com.google.gerrit.server.account.VersionedAccountPreferences in project gerrit by GerritCodeReview.
the class SetDiffPreferences method writeToGit.
private DiffPreferencesInfo writeToGit(DiffPreferencesInfo in) throws RepositoryNotFoundException, IOException, ConfigInvalidException {
DiffPreferencesInfo out = new DiffPreferencesInfo();
try (MetaDataUpdate md = metaDataUpdateFactory.get().create(allUsersName)) {
VersionedAccountPreferences prefs = VersionedAccountPreferences.forDefault();
prefs.load(md);
DiffPreferencesInfo defaults = DiffPreferencesInfo.defaults();
storeSection(prefs.getConfig(), UserConfigSections.DIFF, null, in, defaults);
prefs.commit(md);
loadSection(prefs.getConfig(), UserConfigSections.DIFF, null, out, DiffPreferencesInfo.defaults(), null);
}
return out;
}
Aggregations