commit | bf9dd10505d90d8cafed55713891a5b474b25edc | [log] [tgz] |
---|---|---|
author | David Pursehouse <dpursehouse@collab.net> | Tue Aug 06 14:06:08 2019 +0900 |
committer | David Pursehouse <dpursehouse@collab.net> | Thu Aug 08 15:09:19 2019 +0900 |
tree | 71dacea09accf4600dcb6b46065f2566fb5240e3 | |
parent | 6c939bfceb4693c6fe84aa45002db12af44ea860 [diff] |
Stop using deprecated Repository.getAllRefs Repository.getAllRefs() is deprecated in favor of getRefDatabase.getRefs(). Change-Id: Idf569cd7347de7c2c3a9a614f5a7104ae7e43c51
diff --git a/src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java b/src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java index d4af191..30e40ca 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java +++ b/src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java
@@ -204,7 +204,7 @@ Integer rev = 1; String deletedName = branchName.replaceFirst(R_REFS, ""); try (Repository git = repoManager.openRepository(project.getNameKey())) { - for (Ref ref : git.getAllRefs().values()) { + for (Ref ref : git.getRefDatabase().getRefs()) { String name = ref.getName(); if (name.startsWith(R_BACKUPS + deletedName + "/")) { Integer thisNum = Integer.parseInt(name.substring(name.lastIndexOf('/') + 1));