From aaf41a51b7a5382d48eda3e54db9ef704ea1bf52 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Wed, 26 Dec 2018 15:58:46 -0800 Subject: [PATCH] Move BaseReceivePack#db getter to ReceivePack Another step toward eliminating BaseReceivePack as a separate API. Change-Id: If7b7d5c65a043607a2424211adb479fa33a9077b Signed-off-by: Jonathan Nieder Signed-off-by: Matthias Sohn --- org.eclipse.jgit/.settings/.api_filters | 6 ++++++ .../org/eclipse/jgit/transport/BaseReceivePack.java | 8 ++++---- .../src/org/eclipse/jgit/transport/ReceivePack.java | 10 ++++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/org.eclipse.jgit/.settings/.api_filters b/org.eclipse.jgit/.settings/.api_filters index 64b28b4a8..4dc35df4a 100644 --- a/org.eclipse.jgit/.settings/.api_filters +++ b/org.eclipse.jgit/.settings/.api_filters @@ -37,6 +37,12 @@ + + + + + + diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java index 616ed7090..d4942e680 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java @@ -151,7 +151,7 @@ public abstract class BaseReceivePack { } /** Database we write the stored objects into. */ - private final Repository db; + final Repository db; /** Revision traversal support over {@link #db}. */ private final RevWalk walk; @@ -421,10 +421,10 @@ public abstract class BaseReceivePack { * Get the repository this receive completes into. * * @return the repository this receive completes into. + * @deprecated use {@link ReceivePack#getRepository} */ - public final Repository getRepository() { - return db; - } + @Deprecated + public abstract Repository getRepository(); /** * Get the RevWalk instance used by this connection. diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java index 689d38497..912d6c5da 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java @@ -92,6 +92,16 @@ public class ReceivePack extends BaseReceivePack { postReceive = PostReceiveHook.NULL; } + /** + * Get the repository this receive completes into. + * + * @return the repository this receive completes into. + */ + @Override + public final Repository getRepository() { + return db; + } + /** * Get the push certificate used to verify the pusher's identity. *