Merge "ReceiveCommits: Fix set comparison to avoid no-op group updates"

This commit is contained in:
Dave Borowitz
2016-02-10 20:16:50 +00:00
committed by Gerrit Code Review
2 changed files with 41 additions and 1 deletions

View File

@@ -2448,7 +2448,7 @@ public class ReceiveCommits {
if (groups == null) {
return false;
}
} else if (Sets.newHashSet(oldGroups).equals(groups)) {
} else if (sameGroups(oldGroups, groups)) {
return false;
}
psUtil.setGroups(ctx.getDb(), ctx.getUpdate(psId), ps, groups);
@@ -2459,6 +2459,10 @@ public class ReceiveCommits {
}
}
private boolean sameGroups(List<String> a, List<String> b) {
return Sets.newHashSet(a).equals(Sets.newHashSet(b));
}
CheckedFuture<Void, RestApiException> updateGroups() {
final Thread caller = Thread.currentThread();
ListenableFuture<Void> future = changeUpdateExector.submit(