aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2018-12-18 15:44:44 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2018-12-20 08:37:45 +0900
commit2269669fb11224da272aebe2f02393388c62a0fd (patch)
tree4e571b14cc230c7590e0a86e68a4dda56284a4c8 /org.eclipse.jgit/src
parent9372cf496f4584a580c57253e6945750bb15a307 (diff)
downloadjgit-2269669fb11224da272aebe2f02393388c62a0fd.tar.gz
jgit-2269669fb11224da272aebe2f02393388c62a0fd.zip
TransferConfig: Make constructors public
UploadPack has a setTransferConfig method which allows to set the transfer config, however since the constructors of TransferConfig have the default package visibility it is not possible for any application using UploadPack, for example Gerrit, to actually set a transfer config. Make the constructors public. This is consistent with the public constructors for example on PackConfig. Change-Id: I07080255838421871403b2b2bcc294aa8f621c57 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit/src')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java23
1 files changed, 21 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java
index 6b8d5c598e..59740c4dc8 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java
@@ -133,12 +133,31 @@ public class TransferConfig {
final @Nullable ProtocolVersion protocolVersion;
final String[] hideRefs;
- TransferConfig(Repository db) {
+ /**
+ * Create a configuration honoring the repository's settings.
+ *
+ * @param db
+ * the repository to read settings from. The repository is not
+ * retained by the new configuration, instead its settings are
+ * copied during the constructor.
+ * @since 5.1.4
+ */
+ public TransferConfig(Repository db) {
this(db.getConfig());
}
+ /**
+ * Create a configuration honoring settings in a
+ * {@link org.eclipse.jgit.lib.Config}.
+ *
+ * @param rc
+ * the source to read settings from. The source is not retained
+ * by the new configuration, instead its settings are copied
+ * during the constructor.
+ * @since 5.1.4
+ */
@SuppressWarnings("nls")
- TransferConfig(Config rc) {
+ public TransferConfig(Config rc) {
boolean fsck = rc.getBoolean("transfer", "fsckobjects", false);
fetchFsck = rc.getBoolean("fetch", "fsckobjects", fsck);
receiveFsck = rc.getBoolean("receive", "fsckobjects", fsck);