From ddf1c1ed3c3f1ecc8442c201108134eeec479a8c Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Sat, 9 Oct 2021 02:47:03 +0200 Subject: [PATCH] Pull up additionalRefsNames from RefDirectory to RefDatabase This enables to reuse this constant in all RefDatabase implementations. Change-Id: I13d8fb780de24f71e005b698965fb5bcdbf3c728 --- org.eclipse.jgit/.settings/.api_filters | 8 ++++++++ .../eclipse/jgit/internal/storage/file/RefDirectory.java | 5 ----- .../src/org/eclipse/jgit/lib/RefDatabase.java | 9 +++++++++ 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/org.eclipse.jgit/.settings/.api_filters b/org.eclipse.jgit/.settings/.api_filters index ae801e21ca..5031e3e75f 100644 --- a/org.eclipse.jgit/.settings/.api_filters +++ b/org.eclipse.jgit/.settings/.api_filters @@ -8,4 +8,12 @@ + + + + + + + + diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java index 7d3792ef46..8671583ad2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java @@ -108,11 +108,6 @@ public class RefDirectory extends RefDatabase { /** If in the header, denotes the file has peeled data. */ public static final String PACKED_REFS_PEELED = " peeled"; //$NON-NLS-1$ - /** The names of the additional refs supported by this class */ - private static final String[] additionalRefsNames = new String[] { - Constants.MERGE_HEAD, Constants.FETCH_HEAD, Constants.ORIG_HEAD, - Constants.CHERRY_PICK_HEAD }; - @SuppressWarnings("boxing") private static final List RETRY_SLEEP_MS = Collections.unmodifiableList(Arrays.asList(0, 100, 200, 400, 800, 1600)); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java index 7b7bdebac8..9848bc555b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java @@ -68,6 +68,15 @@ public abstract class RefDatabase { */ public static final String ALL = "";//$NON-NLS-1$ + /** + * The names of additional refs + * + * @since 6.5 + */ + protected static final String[] additionalRefsNames = new String[] { + Constants.MERGE_HEAD, Constants.FETCH_HEAD, Constants.ORIG_HEAD, + Constants.CHERRY_PICK_HEAD, Constants.REVERT_HEAD }; + /** * Initialize a new reference database at this location. * -- 2.39.5