Use Constants.EMPTY_TREE_ID from JGit

Change-Id: Id0e806865a60daaeb1ce9852f2ae4e873978054c
This commit is contained in:
Dave Borowitz
2019-05-16 15:32:56 +02:00
committed by David Pursehouse
parent b4b7c82382
commit 1c8de10423
2 changed files with 4 additions and 8 deletions

View File

@@ -16,6 +16,7 @@ package com.google.gerrit.gpg;
import static com.google.common.base.Preconditions.checkState;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.eclipse.jgit.lib.Constants.EMPTY_TREE_ID;
import static org.eclipse.jgit.lib.Constants.OBJ_BLOB;
import com.google.common.base.Preconditions;
@@ -75,10 +76,6 @@ import org.eclipse.jgit.util.NB;
* after checking with a {@link PublicKeyChecker}.
*/
public class PublicKeyStore implements AutoCloseable {
private static final ObjectId EMPTY_TREE =
ObjectId.fromString("4b825dc642cb6eb9a060e54bf8d69288fbee4904");
/** Ref where GPG public keys are stored. */
public static final String REFS_GPG_KEYS = "refs/meta/gpg-keys";
@@ -361,7 +358,7 @@ public class PublicKeyStore implements AutoCloseable {
deleteFromNotes(ins, fp);
}
cb.setTreeId(notes.writeTree(ins));
if (cb.getTreeId().equals(tip != null ? tip.getTree() : EMPTY_TREE)) {
if (cb.getTreeId().equals(tip != null ? tip.getTree() : EMPTY_TREE_ID)) {
return RefUpdate.Result.NO_CHANGE;
}