Fix ref state for starred changes to be in All-Users

This was a bug in I622dbbb3, which accidentally referenced the starred
change ref in the project repo. Add tests that hopefully should make
this kind of thing easier to spot.

Change-Id: If908c6ea7bbe99be113b6b0c87b5be311ed7547c
This commit is contained in:
Dave Borowitz
2016-11-30 10:36:33 -05:00
parent 629f42bda3
commit e5e2bfb9d2
3 changed files with 103 additions and 2 deletions

View File

@@ -971,7 +971,7 @@ public class ChangeField {
input.editRefs().values().forEach(
r -> result.add(RefState.of(r).toByteArray(project)));
input.starRefs().values().forEach(
r -> result.add(RefState.of(r.ref()).toByteArray(project)));
r -> result.add(RefState.of(r.ref()).toByteArray(args.allUsers)));
if (PrimaryStorage.of(input.change()) == PrimaryStorage.NOTE_DB) {
ChangeNotes notes = input.notes();

View File

@@ -62,7 +62,7 @@ public class StalenessChecker {
private static final Logger log =
LoggerFactory.getLogger(StalenessChecker.class);
private final ImmutableSet<String> FIELDS = ImmutableSet.of(
public static final ImmutableSet<String> FIELDS = ImmutableSet.of(
ChangeField.CHANGE.getName(),
ChangeField.REF_STATE.getName(),
ChangeField.REF_STATE_PATTERN.getName());