Read mergeable bit from cache
Change callers on the client side to get this from ChangeInfo (populated by ChangeJson) rather than Change. Continue writing to the database, to facilitate online migration. Change-Id: I7273e0253d357ff80aa3baf2b833419749b958ef
This commit is contained in:
@@ -106,6 +106,12 @@ public class MergeabilityCache {
|
||||
};
|
||||
}
|
||||
|
||||
public static ObjectId toId(Ref ref) {
|
||||
return ref != null && ref.getObjectId() != null
|
||||
? ref.getObjectId()
|
||||
: ObjectId.zeroId();
|
||||
}
|
||||
|
||||
public static class EntryKey implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -307,4 +313,10 @@ public class MergeabilityCache {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getIfPresent(ObjectId commit, Ref intoRef,
|
||||
SubmitType submitType, String mergeStrategy) {
|
||||
return cache.getIfPresent(new EntryKey(
|
||||
commit, toId(intoRef), submitType, mergeStrategy, null, null, null));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user