Move refs/cache-automerge/ generation logic to RefNames
Change-Id: Id9b0c1364484205d435cb2f35469a0d95e439757
This commit is contained in:
parent
9acdc6ec0a
commit
7d8667d2cf
@ -140,6 +140,13 @@ public class RefNames {
|
||||
return r;
|
||||
}
|
||||
|
||||
public static String refsCacheAutomerge(String hash) {
|
||||
return REFS_CACHE_AUTOMERGE
|
||||
+ hash.substring(0, 2)
|
||||
+ '/'
|
||||
+ hash.substring(2);
|
||||
}
|
||||
|
||||
public static String shard(int id) {
|
||||
if (id < 0) {
|
||||
return null;
|
||||
|
@ -96,11 +96,7 @@ public class AutoMerger {
|
||||
}
|
||||
|
||||
rw.parseHeaders(merge);
|
||||
String hash = merge.name();
|
||||
String refName = RefNames.REFS_CACHE_AUTOMERGE
|
||||
+ hash.substring(0, 2)
|
||||
+ "/"
|
||||
+ hash.substring(2);
|
||||
String refName = RefNames.refsCacheAutomerge(merge.name());
|
||||
Ref ref = repo.getRefDatabase().exactRef(refName);
|
||||
if (ref != null && ref.getObjectId() != null) {
|
||||
RevObject obj = rw.parseAny(ref.getObjectId());
|
||||
|
Loading…
x
Reference in New Issue
Block a user