Exclude NoteDb meta refs from TagSet

Similar to normal change refs, meta refs are not tag-able. Excluding
them from the list of interesting refs in TagSet scales down on the
amount of work we have to do later on when calculating tags.

The fewer references we have prior to calculating the tags, the less
memory we'll need when using BitSets to deal with refs flags.

Change-Id: Idc3308e3378bfede57d95cd65457129484385794
This commit is contained in:
Patrick Hiesel
2018-02-05 10:40:12 +01:00
parent 7229c9d50c
commit 545ce5b6e0

View File

@@ -19,6 +19,7 @@ import static org.eclipse.jgit.lib.ObjectIdSerialization.writeNotNull;
import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.reviewdb.client.RefNames;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
@@ -327,7 +328,10 @@ class TagSet {
}
static boolean skip(Ref ref) {
return ref.isSymbolic() || ref.getObjectId() == null || PatchSet.isChangeRef(ref.getName());
return ref.isSymbolic()
|| ref.getObjectId() == null
|| PatchSet.isChangeRef(ref.getName())
|| RefNames.isNoteDbMetaRef(ref.getName());
}
private static boolean isTag(Ref ref) {