Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.bazelversion2
-rw-r--r--WORKSPACE2
-rw-r--r--lib/jmh/BUILD2
-rw-r--r--org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.benchmarks/BUILD2
-rw-r--r--org.eclipse.jgit.benchmarks/pom.xml27
-rw-r--r--org.eclipse.jgit.benchmarks/src/org/eclipse/jgit/benchmarks/CreateFileSnapshotBenchmark.java1
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartOutputStream.java31
-rw-r--r--org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java5
-rw-r--r--org.eclipse.jgit.junit/.settings/.api_filters11
-rw-r--r--org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.target6
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.tpd3
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.target6
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.tpd2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12-staging.tpd8
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.target (renamed from org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12-staging.target)6
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.tpd8
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target6
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.tpd2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.target6
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.tpd2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.target6
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.tpd2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.target6
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.tpd2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/projects/jetty-9.4.14.tpd2
-rw-r--r--org.eclipse.jgit.packaging/pom.xml6
-rw-r--r--org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Daemon.java29
-rw-r--r--org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/ApacheSshTest.java1
-rw-r--r--org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollectorTest.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/BatchRefUpdateTest.java346
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcOrphanFilesTest.java24
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/WindowCacheGetTest.java71
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/transport/http/NetscapeCookieFileTest.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/FileBasedConfigTest.java40
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/StatsTest.java1
-rw-r--r--org.eclipse.jgit/.settings/.api_filters75
-rw-r--r--org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileSnapshot.java27
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java18
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java25
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java37
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCache.java616
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java54
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java36
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/GitmoduleEntry.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheConfig.java64
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheStats.java185
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/AbstractTreeIterator.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/CanonicalTreeParser.java9
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/Monitoring.java89
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/SshSupport.java14
-rw-r--r--pom.xml39
-rw-r--r--tools/bzl/jmh.bzl8
63 files changed, 1654 insertions, 347 deletions
diff --git a/.bazelversion b/.bazelversion
index 3eefcb9dd5..227cea2156 100644
--- a/.bazelversion
+++ b/.bazelversion
@@ -1 +1 @@
-1.0.0
+2.0.0
diff --git a/WORKSPACE b/WORKSPACE
index 1d02d2bceb..4fa9968383 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -15,7 +15,7 @@ versions.check(minimum_bazel_version = "0.29.0")
load("//tools:bazlets.bzl", "load_bazlets")
-load_bazlets(commit = "09a035e98077dce549d5f6a7472d06c4b8f792d2")
+load_bazlets(commit = "f53f51fb660552d0581aa0ba52c3836ed63d56a3")
load(
"@com_googlesource_gerrit_bazlets//tools:maven_jar.bzl",
diff --git a/lib/jmh/BUILD b/lib/jmh/BUILD
index deb2a78def..b15e66c2b9 100644
--- a/lib/jmh/BUILD
+++ b/lib/jmh/BUILD
@@ -9,4 +9,4 @@ java_library(
"@jopt//jar",
"@math3//jar",
],
-) \ No newline at end of file
+)
diff --git a/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs
index 2ca78ff2d0..d4751b5352 100644
--- a/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs
@@ -52,7 +52,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
diff --git a/org.eclipse.jgit.benchmarks/BUILD b/org.eclipse.jgit.benchmarks/BUILD
index 3c6ff0e12b..7e331b101a 100644
--- a/org.eclipse.jgit.benchmarks/BUILD
+++ b/org.eclipse.jgit.benchmarks/BUILD
@@ -10,4 +10,4 @@ jmh_java_benchmarks(
deps = [
"//org.eclipse.jgit:jgit",
],
-) \ No newline at end of file
+)
diff --git a/org.eclipse.jgit.benchmarks/pom.xml b/org.eclipse.jgit.benchmarks/pom.xml
index 877f2feb11..2dd6a85031 100644
--- a/org.eclipse.jgit.benchmarks/pom.xml
+++ b/org.eclipse.jgit.benchmarks/pom.xml
@@ -189,6 +189,33 @@
</lifecycleMappingMetadata>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.8.2</version>
+ <dependencies>
+ <dependency><!-- add support for ssh/scp -->
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-ssh</artifactId>
+ <version>3.3.4</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <version>3.0.0-M3</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jxr-plugin</artifactId>
+ <version>3.0.0</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>3.0.0</version>
+ </plugin>
</plugins>
</pluginManagement>
</build>
diff --git a/org.eclipse.jgit.benchmarks/src/org/eclipse/jgit/benchmarks/CreateFileSnapshotBenchmark.java b/org.eclipse.jgit.benchmarks/src/org/eclipse/jgit/benchmarks/CreateFileSnapshotBenchmark.java
index ffe4a26d8b..21c54c563f 100644
--- a/org.eclipse.jgit.benchmarks/src/org/eclipse/jgit/benchmarks/CreateFileSnapshotBenchmark.java
+++ b/org.eclipse.jgit.benchmarks/src/org/eclipse/jgit/benchmarks/CreateFileSnapshotBenchmark.java
@@ -45,7 +45,6 @@ package org.eclipse.jgit.benchmarks;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
-import java.util.UUID;
import java.util.concurrent.TimeUnit;
import org.eclipse.jgit.internal.storage.file.FileSnapshot;
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartOutputStream.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartOutputStream.java
index 06bdce679d..0dfaec2567 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartOutputStream.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartOutputStream.java
@@ -105,18 +105,16 @@ class SmartOutputStream extends TemporaryBuffer {
// If output hasn't started yet, the entire thing fit into our
// buffer. Try to use a proper Content-Length header, and also
// deflate the response with gzip if it will be smaller.
- @SuppressWarnings("resource")
- TemporaryBuffer out = this;
-
- if (256 < out.length() && acceptsGzipEncoding(req)) {
+ if (256 < this.length() && acceptsGzipEncoding(req)) {
TemporaryBuffer gzbuf = new TemporaryBuffer.Heap(LIMIT);
try {
try (GZIPOutputStream gzip = new GZIPOutputStream(gzbuf)) {
- out.writeTo(gzip, null);
+ this.writeTo(gzip, null);
}
- if (gzbuf.length() < out.length()) {
- out = gzbuf;
+ if (gzbuf.length() < this.length()) {
rsp.setHeader(HDR_CONTENT_ENCODING, ENCODING_GZIP);
+ writeResponse(gzbuf);
+ return;
}
} catch (IOException err) {
// Most likely caused by overflowing the buffer, meaning
@@ -124,15 +122,18 @@ class SmartOutputStream extends TemporaryBuffer {
// copy and use the original.
}
}
+ writeResponse(this);
+ }
+ }
- // The Content-Length cannot overflow when cast to an int, our
- // hardcoded LIMIT constant above assures us we wouldn't store
- // more than 2 GiB of content in memory.
- rsp.setContentLength((int) out.length());
- try (OutputStream os = rsp.getOutputStream()) {
- out.writeTo(os, null);
- os.flush();
- }
+ private void writeResponse(TemporaryBuffer out) throws IOException {
+ // The Content-Length cannot overflow when cast to an int, our
+ // hardcoded LIMIT constant above assures us we wouldn't store
+ // more than 2 GiB of content in memory.
+ rsp.setContentLength((int) out.length());
+ try (OutputStream os = rsp.getOutputStream()) {
+ out.writeTo(os, null);
+ os.flush();
}
}
}
diff --git a/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs
index 2ca78ff2d0..d4751b5352 100644
--- a/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs
@@ -52,7 +52,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java
index 9aef086b78..ba0138b81e 100644
--- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java
+++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java
@@ -214,9 +214,12 @@ public class AppServer {
tmpDir.deleteOnExit();
makePrivate(tmpDir);
File keyStore = new File(tmpDir, "keystore.jks");
+ File keytool = new File(
+ new File(new File(System.getProperty("java.home")), "bin"),
+ "keytool");
Runtime.getRuntime().exec(
new String[] {
- "keytool", //
+ keytool.getAbsolutePath(), //
"-keystore", keyStore.getAbsolutePath(), //
"-storepass", keyPassword,
"-alias", hostName, //
diff --git a/org.eclipse.jgit.junit/.settings/.api_filters b/org.eclipse.jgit.junit/.settings/.api_filters
new file mode 100644
index 0000000000..05665a3d15
--- /dev/null
+++ b/org.eclipse.jgit.junit/.settings/.api_filters
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<component id="org.eclipse.jgit.junit" version="2">
+ <resource path="src/org/eclipse/jgit/junit/Repeat.java" type="org.eclipse.jgit.junit.Repeat">
+ <filter id="1092616195">
+ <message_arguments>
+ <message_argument value="5.1.9"/>
+ <message_argument value="abortOnFailure()"/>
+ </message_arguments>
+ </filter>
+ </resource>
+</component>
diff --git a/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs
index 2ca78ff2d0..d4751b5352 100644
--- a/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs
@@ -52,7 +52,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
diff --git a/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs
index 2ca78ff2d0..d4751b5352 100644
--- a/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs
@@ -52,7 +52,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.target
index 36660ff3e6..941d4961d7 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.target
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.target
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
-<target name="jgit-4.10" sequenceNumber="1566251637">
+<target name="jgit-4.10" sequenceNumber="1638580694">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.14.v20181114"/>
@@ -20,7 +20,7 @@
<unit id="org.eclipse.jetty.servlet.source" version="9.4.14.v20181114"/>
<unit id="org.eclipse.jetty.util" version="9.4.14.v20181114"/>
<unit id="org.eclipse.jetty.util.source" version="9.4.14.v20181114"/>
- <repository id="jetty-9.4.14" location="http://download.eclipse.org/jetty/updates/jetty-bundles-9.x/9.4.14.v20181114"/>
+ <repository id="jetty-9.4.14" location="https://archive.eclipse.org/jetty/updates/jetty-bundles-9.x/jetty-bundles-9.x/9.4.14.v20181114"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.apache.ant" version="1.10.5.v20190526-1402"/>
@@ -86,7 +86,7 @@
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>
- <repository location="http://download.eclipse.org/releases/2018-12/"/>
+ <repository location="https://download.eclipse.org/releases/2018-12/"/>
</location>
</locations>
</target>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.tpd
index 6beb42e33a..fad2e92005 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.tpd
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.tpd
@@ -3,6 +3,7 @@ target "jgit-4.10" with source configurePhase
include "projects/jetty-9.4.14.tpd"
include "orbit/R20190602212107-2019-06.tpd"
-location "http://download.eclipse.org/releases/2018-12/" {
+location "https://download.eclipse.org/releases/2018-12/" {
org.eclipse.osgi lazy
}
+
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.target
index afa4b3da2c..4be2f466d2 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.target
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.target
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
-<target name="jgit-4.11" sequenceNumber="1566251633">
+<target name="jgit-4.11" sequenceNumber="1638580694">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.14.v20181114"/>
@@ -20,7 +20,7 @@
<unit id="org.eclipse.jetty.servlet.source" version="9.4.14.v20181114"/>
<unit id="org.eclipse.jetty.util" version="9.4.14.v20181114"/>
<unit id="org.eclipse.jetty.util.source" version="9.4.14.v20181114"/>
- <repository id="jetty-9.4.14" location="http://download.eclipse.org/jetty/updates/jetty-bundles-9.x/9.4.14.v20181114"/>
+ <repository id="jetty-9.4.14" location="https://archive.eclipse.org/jetty/updates/jetty-bundles-9.x/jetty-bundles-9.x/9.4.14.v20181114"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.apache.ant" version="1.10.5.v20190526-1402"/>
@@ -86,7 +86,7 @@
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>
- <repository location="http://download.eclipse.org/releases/2019-03/"/>
+ <repository location="https://download.eclipse.org/releases/2019-03/"/>
</location>
</locations>
</target>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.tpd
index e09e8c387d..0864e7647f 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.tpd
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.tpd
@@ -3,6 +3,6 @@ target "jgit-4.11" with source configurePhase
include "projects/jetty-9.4.14.tpd"
include "orbit/R20190602212107-2019-06.tpd"
-location "http://download.eclipse.org/releases/2019-03/" {
+location "https://download.eclipse.org/releases/2019-03/" {
org.eclipse.osgi lazy
}
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12-staging.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12-staging.tpd
deleted file mode 100644
index 43b64a0301..0000000000
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12-staging.tpd
+++ /dev/null
@@ -1,8 +0,0 @@
-target "jgit-4.12-staging" with source configurePhase
-
-include "projects/jetty-9.4.14.tpd"
-include "orbit/R20190602212107-2019-06.tpd"
-
-location "http://download.eclipse.org/staging/2019-06/" {
- org.eclipse.osgi lazy
-}
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12-staging.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.target
index 92c9a88366..34ffd455a6 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12-staging.target
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.target
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
-<target name="jgit-4.12-staging" sequenceNumber="1566251632">
+<target name="jgit-4.12" sequenceNumber="1638580694">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.14.v20181114"/>
@@ -20,7 +20,7 @@
<unit id="org.eclipse.jetty.servlet.source" version="9.4.14.v20181114"/>
<unit id="org.eclipse.jetty.util" version="9.4.14.v20181114"/>
<unit id="org.eclipse.jetty.util.source" version="9.4.14.v20181114"/>
- <repository id="jetty-9.4.14" location="http://download.eclipse.org/jetty/updates/jetty-bundles-9.x/9.4.14.v20181114"/>
+ <repository id="jetty-9.4.14" location="https://archive.eclipse.org/jetty/updates/jetty-bundles-9.x/jetty-bundles-9.x/9.4.14.v20181114"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.apache.ant" version="1.10.5.v20190526-1402"/>
@@ -86,7 +86,7 @@
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>
- <repository location="http://download.eclipse.org/staging/2019-06/"/>
+ <repository location="https://download.eclipse.org/releases/2019-06/"/>
</location>
</locations>
</target>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.tpd
new file mode 100644
index 0000000000..cff602607a
--- /dev/null
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.tpd
@@ -0,0 +1,8 @@
+target "jgit-4.12" with source configurePhase
+
+include "projects/jetty-9.4.14.tpd"
+include "orbit/R20190602212107-2019-06.tpd"
+
+location "https://download.eclipse.org/releases/2019-06/" {
+ org.eclipse.osgi lazy
+}
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target
index 9724939f8a..489b01c58a 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
-<target name="jgit-4.6" sequenceNumber="1566251641">
+<target name="jgit-4.6" sequenceNumber="1638580694">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.14.v20181114"/>
@@ -20,7 +20,7 @@
<unit id="org.eclipse.jetty.servlet.source" version="9.4.14.v20181114"/>
<unit id="org.eclipse.jetty.util" version="9.4.14.v20181114"/>
<unit id="org.eclipse.jetty.util.source" version="9.4.14.v20181114"/>
- <repository id="jetty-9.4.14" location="http://download.eclipse.org/jetty/updates/jetty-bundles-9.x/9.4.14.v20181114"/>
+ <repository id="jetty-9.4.14" location="https://archive.eclipse.org/jetty/updates/jetty-bundles-9.x/jetty-bundles-9.x/9.4.14.v20181114"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.apache.ant" version="1.10.5.v20190526-1402"/>
@@ -86,7 +86,7 @@
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>
- <repository location="http://download.eclipse.org/releases/neon/"/>
+ <repository location="https://download.eclipse.org/releases/neon/"/>
</location>
</locations>
</target>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.tpd
index 1a2c9a3a16..a43593f29b 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.tpd
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.tpd
@@ -3,6 +3,6 @@ target "jgit-4.6" with source configurePhase
include "projects/jetty-9.4.14.tpd"
include "orbit/R20190602212107-2019-06.tpd"
-location "http://download.eclipse.org/releases/neon/" {
+location "https://download.eclipse.org/releases/neon/" {
org.eclipse.osgi lazy
} \ No newline at end of file
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.target
index 6bd70e0160..627a83a755 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.target
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.target
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
-<target name="jgit-4.7" sequenceNumber="1566251627">
+<target name="jgit-4.7" sequenceNumber="1638580694">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.14.v20181114"/>
@@ -20,7 +20,7 @@
<unit id="org.eclipse.jetty.servlet.source" version="9.4.14.v20181114"/>
<unit id="org.eclipse.jetty.util" version="9.4.14.v20181114"/>
<unit id="org.eclipse.jetty.util.source" version="9.4.14.v20181114"/>
- <repository id="jetty-9.4.14" location="http://download.eclipse.org/jetty/updates/jetty-bundles-9.x/9.4.14.v20181114"/>
+ <repository id="jetty-9.4.14" location="https://archive.eclipse.org/jetty/updates/jetty-bundles-9.x/jetty-bundles-9.x/9.4.14.v20181114"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.apache.ant" version="1.10.5.v20190526-1402"/>
@@ -86,7 +86,7 @@
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>
- <repository location="http://download.eclipse.org/releases/oxygen/"/>
+ <repository location="https://download.eclipse.org/releases/oxygen/"/>
</location>
</locations>
</target>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.tpd
index fc1b046edd..32835cabbf 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.tpd
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.tpd
@@ -3,6 +3,6 @@ target "jgit-4.7" with source configurePhase
include "projects/jetty-9.4.14.tpd"
include "orbit/R20190602212107-2019-06.tpd"
-location "http://download.eclipse.org/releases/oxygen/" {
+location "https://download.eclipse.org/releases/oxygen/" {
org.eclipse.osgi lazy
}
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.target
index e33ece710a..dc45c7d16e 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.target
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.target
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
-<target name="jgit-4.8" sequenceNumber="1566251616">
+<target name="jgit-4.8" sequenceNumber="1638580694">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.14.v20181114"/>
@@ -20,7 +20,7 @@
<unit id="org.eclipse.jetty.servlet.source" version="9.4.14.v20181114"/>
<unit id="org.eclipse.jetty.util" version="9.4.14.v20181114"/>
<unit id="org.eclipse.jetty.util.source" version="9.4.14.v20181114"/>
- <repository id="jetty-9.4.14" location="http://download.eclipse.org/jetty/updates/jetty-bundles-9.x/9.4.14.v20181114"/>
+ <repository id="jetty-9.4.14" location="https://archive.eclipse.org/jetty/updates/jetty-bundles-9.x/jetty-bundles-9.x/9.4.14.v20181114"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.apache.ant" version="1.10.5.v20190526-1402"/>
@@ -86,7 +86,7 @@
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>
- <repository location="http://download.eclipse.org/releases/photon/"/>
+ <repository location="https://download.eclipse.org/releases/photon/"/>
</location>
</locations>
</target>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.tpd
index a8f837e9ca..c11bc62fc2 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.tpd
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.tpd
@@ -3,6 +3,6 @@ target "jgit-4.8" with source configurePhase
include "projects/jetty-9.4.14.tpd"
include "orbit/R20190602212107-2019-06.tpd"
-location "http://download.eclipse.org/releases/photon/" {
+location "https://download.eclipse.org/releases/photon/" {
org.eclipse.osgi lazy
}
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.target
index 9b3fe1b930..040c1d1274 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.target
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.target
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
-<target name="jgit-4.9" sequenceNumber="1566251604">
+<target name="jgit-4.9" sequenceNumber="1638580694">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.14.v20181114"/>
@@ -20,7 +20,7 @@
<unit id="org.eclipse.jetty.servlet.source" version="9.4.14.v20181114"/>
<unit id="org.eclipse.jetty.util" version="9.4.14.v20181114"/>
<unit id="org.eclipse.jetty.util.source" version="9.4.14.v20181114"/>
- <repository id="jetty-9.4.14" location="http://download.eclipse.org/jetty/updates/jetty-bundles-9.x/9.4.14.v20181114"/>
+ <repository id="jetty-9.4.14" location="https://archive.eclipse.org/jetty/updates/jetty-bundles-9.x/jetty-bundles-9.x/9.4.14.v20181114"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.apache.ant" version="1.10.5.v20190526-1402"/>
@@ -86,7 +86,7 @@
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>
- <repository location="http://download.eclipse.org/releases/2018-09/"/>
+ <repository location="https://download.eclipse.org/releases/2018-09/"/>
</location>
</locations>
</target>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.tpd
index f91f53eb8b..a2658b4382 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.tpd
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.tpd
@@ -3,6 +3,6 @@ target "jgit-4.9" with source configurePhase
include "projects/jetty-9.4.14.tpd"
include "orbit/R20190602212107-2019-06.tpd"
-location "http://download.eclipse.org/releases/2018-09/" {
+location "https://download.eclipse.org/releases/2018-09/" {
org.eclipse.osgi lazy
} \ No newline at end of file
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/projects/jetty-9.4.14.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/projects/jetty-9.4.14.tpd
index 5372e77e5a..fb0963ef73 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/projects/jetty-9.4.14.tpd
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/projects/jetty-9.4.14.tpd
@@ -1,6 +1,6 @@
target "jetty-9.4.14" with source configurePhase
-location jetty-9.4.14 "http://download.eclipse.org/jetty/updates/jetty-bundles-9.x/9.4.14.v20181114" {
+location jetty-9.4.14 "https://archive.eclipse.org/jetty/updates/jetty-bundles-9.x/jetty-bundles-9.x/9.4.14.v20181114" {
org.eclipse.jetty.client [9.4.14.v20181114,9.4.14.v20181114]
org.eclipse.jetty.client.source [9.4.14.v20181114,9.4.14.v20181114]
org.eclipse.jetty.continuation [9.4.14.v20181114,9.4.14.v20181114]
diff --git a/org.eclipse.jgit.packaging/pom.xml b/org.eclipse.jgit.packaging/pom.xml
index f86abfa2a3..5a90df0989 100644
--- a/org.eclipse.jgit.packaging/pom.xml
+++ b/org.eclipse.jgit.packaging/pom.xml
@@ -55,7 +55,7 @@
<name>JGit Tycho Parent</name>
<properties>
- <tycho-version>1.4.0</tycho-version>
+ <tycho-version>1.7.0</tycho-version>
<tycho-extras-version>${tycho-version}</tycho-extras-version>
<target-platform>jgit-4.6</target-platform>
</properties>
@@ -313,7 +313,7 @@
<plugin>
<groupId>org.eclipse.cbi.maven.plugins</groupId>
<artifactId>eclipse-jarsigner-plugin</artifactId>
- <version>1.1.5</version>
+ <version>1.3.2</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
@@ -337,7 +337,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
- <version>3.7.1</version>
+ <version>3.8.2</version>
</plugin>
</plugins>
</pluginManagement>
diff --git a/org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs
index 2ca78ff2d0..d4751b5352 100644
--- a/org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs
@@ -52,7 +52,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Daemon.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Daemon.java
index 43826636aa..8b86c16884 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Daemon.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Daemon.java
@@ -44,6 +44,7 @@
package org.eclipse.jgit.pgm;
import java.io.File;
+import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.URISyntaxException;
import java.text.MessageFormat;
@@ -51,12 +52,14 @@ import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executors;
+import org.eclipse.jgit.errors.ConfigInvalidException;
import org.eclipse.jgit.internal.ketch.KetchLeader;
import org.eclipse.jgit.internal.ketch.KetchLeaderCache;
import org.eclipse.jgit.internal.ketch.KetchPreReceive;
import org.eclipse.jgit.internal.ketch.KetchSystem;
import org.eclipse.jgit.internal.ketch.KetchText;
import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.lib.StoredConfig;
import org.eclipse.jgit.pgm.internal.CLIText;
import org.eclipse.jgit.storage.file.FileBasedConfig;
import org.eclipse.jgit.storage.file.WindowCacheConfig;
@@ -68,6 +71,7 @@ import org.eclipse.jgit.transport.resolver.FileResolver;
import org.eclipse.jgit.transport.resolver.ReceivePackFactory;
import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException;
import org.eclipse.jgit.util.FS;
+import org.eclipse.jgit.util.SystemReader;
import org.kohsuke.args4j.Argument;
import org.kohsuke.args4j.Option;
@@ -120,19 +124,20 @@ class Daemon extends TextBuiltin {
@Override
protected void run() throws Exception {
PackConfig packConfig = new PackConfig();
-
- if (configFile != null) {
+ StoredConfig cfg;
+ if (configFile == null) {
+ cfg = getUserConfig();
+ } else {
if (!configFile.exists()) {
throw die(MessageFormat.format(
CLIText.get().configFileNotFound, //
configFile.getAbsolutePath()));
}
-
- FileBasedConfig cfg = new FileBasedConfig(configFile, FS.DETECTED);
- cfg.load();
- new WindowCacheConfig().fromConfig(cfg).install();
- packConfig.fromConfig(cfg);
+ cfg = new FileBasedConfig(configFile, FS.DETECTED);
}
+ cfg.load();
+ new WindowCacheConfig().fromConfig(cfg).install();
+ packConfig.fromConfig(cfg);
int threads = packConfig.getThreads();
if (threads <= 0)
@@ -172,6 +177,16 @@ class Daemon extends TextBuiltin {
outw.println(MessageFormat.format(CLIText.get().listeningOn, d.getAddress()));
}
+ private StoredConfig getUserConfig() throws IOException {
+ StoredConfig userConfig = null;
+ try {
+ userConfig = SystemReader.getInstance().getUserConfig();
+ } catch (ConfigInvalidException e) {
+ throw die(e.getMessage());
+ }
+ return userConfig;
+ }
+
private static DaemonService service(
final org.eclipse.jgit.transport.Daemon d,
final String n) {
diff --git a/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/ApacheSshTest.java b/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/ApacheSshTest.java
index ee58083a5a..98a38ffc43 100644
--- a/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/ApacheSshTest.java
+++ b/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/ApacheSshTest.java
@@ -51,7 +51,6 @@ import java.util.Arrays;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.transport.SshSessionFactory;
import org.eclipse.jgit.transport.ssh.SshTestBase;
-import org.eclipse.jgit.transport.sshd.SshdSessionFactory;
import org.eclipse.jgit.util.FS;
import org.junit.Test;
import org.junit.experimental.theories.Theories;
diff --git a/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs
index 2ca78ff2d0..d4751b5352 100644
--- a/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs
@@ -52,7 +52,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollectorTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollectorTest.java
index 5a5ae1d7a3..858f5b905a 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollectorTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollectorTest.java
@@ -19,7 +19,6 @@ import java.util.Collections;
import java.util.concurrent.TimeUnit;
import org.eclipse.jgit.internal.storage.dfs.DfsObjDatabase.PackSource;
-import org.eclipse.jgit.internal.storage.dfs.DfsRefDatabase;
import org.eclipse.jgit.internal.storage.reftable.RefCursor;
import org.eclipse.jgit.internal.storage.reftable.ReftableConfig;
import org.eclipse.jgit.internal.storage.reftable.ReftableReader;
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/BatchRefUpdateTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/BatchRefUpdateTest.java
index 79cf4d5aff..c211eaba85 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/BatchRefUpdateTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/BatchRefUpdateTest.java
@@ -205,17 +205,33 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
assertRefs(
"refs/heads/master", A,
"refs/heads/masters", B);
- assertEquals(1, refsChangedEvents);
} else {
assertResults(cmds, OK, REJECTED_NONFASTFORWARD);
assertRefs(
"refs/heads/master", B,
"refs/heads/masters", B);
- assertEquals(2, refsChangedEvents);
}
}
@Test
+ public void simpleNoForceRefsChangedEvents() throws IOException {
+ writeLooseRef("refs/heads/master", A);
+ writeLooseRef("refs/heads/masters", B);
+ refdir.exactRef("refs/heads/master");
+ refdir.exactRef("refs/heads/masters");
+ int initialRefsChangedEvents = refsChangedEvents;
+
+ List<ReceiveCommand> cmds = Arrays.asList(
+ new ReceiveCommand(A, B, "refs/heads/master", UPDATE),
+ new ReceiveCommand(B, A, "refs/heads/masters",
+ UPDATE_NONFASTFORWARD));
+ execute(newBatchUpdate(cmds));
+
+ assertEquals(atomic ? initialRefsChangedEvents
+ : initialRefsChangedEvents + 1, refsChangedEvents);
+ }
+
+ @Test
public void simpleForce() throws IOException {
writeLooseRef("refs/heads/master", A);
writeLooseRef("refs/heads/masters", B);
@@ -229,7 +245,24 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
assertRefs(
"refs/heads/master", B,
"refs/heads/masters", A);
- assertEquals(atomic ? 2 : 3, refsChangedEvents);
+ }
+
+ @Test
+ public void simpleForceRefsChangedEvents() throws IOException {
+ writeLooseRef("refs/heads/master", A);
+ writeLooseRef("refs/heads/masters", B);
+ refdir.exactRef("refs/heads/master");
+ refdir.exactRef("refs/heads/masters");
+ int initialRefsChangedEvents = refsChangedEvents;
+
+ List<ReceiveCommand> cmds = Arrays.asList(
+ new ReceiveCommand(A, B, "refs/heads/master", UPDATE),
+ new ReceiveCommand(B, A, "refs/heads/masters",
+ UPDATE_NONFASTFORWARD));
+ execute(newBatchUpdate(cmds).setAllowNonFastForwards(true));
+
+ assertEquals(atomic ? initialRefsChangedEvents + 1
+ : initialRefsChangedEvents + 2, refsChangedEvents);
}
@Test
@@ -251,7 +284,28 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
assertResults(cmds, OK);
assertRefs("refs/heads/master", A);
- assertEquals(2, refsChangedEvents);
+ }
+
+ @Test
+ public void nonFastForwardDoesNotDoExpensiveMergeCheckRefsChangedEvents()
+ throws IOException {
+ writeLooseRef("refs/heads/master", B);
+ refdir.exactRef("refs/heads/master");
+ int initialRefsChangedEvents = refsChangedEvents;
+
+ List<ReceiveCommand> cmds = Arrays.asList(new ReceiveCommand(B, A,
+ "refs/heads/master", UPDATE_NONFASTFORWARD));
+ try (RevWalk rw = new RevWalk(diskRepo) {
+ @Override
+ public boolean isMergedInto(RevCommit base, RevCommit tip) {
+ throw new AssertionError("isMergedInto() should not be called");
+ }
+ }) {
+ newBatchUpdate(cmds).setAllowNonFastForwards(true).execute(rw,
+ new StrictWorkMonitor());
+ }
+
+ assertEquals(initialRefsChangedEvents + 1, refsChangedEvents);
}
@Test
@@ -273,7 +327,6 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
assertRefs(
"refs/heads/master", A,
"refs/heads/masters", B);
- assertEquals(1, refsChangedEvents);
} else {
// Non-atomic updates are applied in order: master succeeds, then master/x
// fails due to conflict.
@@ -281,11 +334,28 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
assertRefs(
"refs/heads/master", B,
"refs/heads/masters", B);
- assertEquals(2, refsChangedEvents);
}
}
@Test
+ public void fileDirectoryConflictRefsChangedEvents() throws IOException {
+ writeLooseRef("refs/heads/master", A);
+ writeLooseRef("refs/heads/masters", B);
+ refdir.exactRef("refs/heads/master");
+ refdir.exactRef("refs/heads/masters");
+ int initialRefsChangedEvents = refsChangedEvents;
+
+ List<ReceiveCommand> cmds = Arrays.asList(
+ new ReceiveCommand(A, B, "refs/heads/master", UPDATE),
+ new ReceiveCommand(zeroId(), A, "refs/heads/master/x", CREATE),
+ new ReceiveCommand(zeroId(), A, "refs/heads", CREATE));
+ execute(newBatchUpdate(cmds).setAllowNonFastForwards(true), false);
+
+ assertEquals(atomic ? initialRefsChangedEvents
+ : initialRefsChangedEvents + 1, refsChangedEvents);
+ }
+
+ @Test
public void conflictThanksToDelete() throws IOException {
writeLooseRef("refs/heads/master", A);
writeLooseRef("refs/heads/masters", B);
@@ -300,15 +370,24 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
assertRefs(
"refs/heads/master", B,
"refs/heads/masters/x", A);
- if (atomic) {
- assertEquals(2, refsChangedEvents);
- } else {
- // The non-atomic case actually produces 5 events, but that's an
- // implementation detail. We expect at least 4 events, one for the
- // initial read due to writeLooseRef(), and then one for each
- // successful ref update.
- assertTrue(refsChangedEvents >= 4);
- }
+ }
+
+ @Test
+ public void conflictThanksToDeleteRefsChangedEvents() throws IOException {
+ writeLooseRef("refs/heads/master", A);
+ writeLooseRef("refs/heads/masters", B);
+ refdir.exactRef("refs/heads/master");
+ refdir.exactRef("refs/heads/masters");
+ int initialRefsChangedEvents = refsChangedEvents;
+
+ List<ReceiveCommand> cmds = Arrays.asList(
+ new ReceiveCommand(A, B, "refs/heads/master", UPDATE),
+ new ReceiveCommand(zeroId(), A, "refs/heads/masters/x", CREATE),
+ new ReceiveCommand(B, zeroId(), "refs/heads/masters", DELETE));
+ execute(newBatchUpdate(cmds).setAllowNonFastForwards(true));
+
+ assertEquals(atomic ? initialRefsChangedEvents + 1
+ : initialRefsChangedEvents + 3, refsChangedEvents);
}
@Test
@@ -325,17 +404,32 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
if (atomic) {
assertResults(cmds, REJECTED_MISSING_OBJECT, TRANSACTION_ABORTED);
assertRefs("refs/heads/master", A);
- assertEquals(1, refsChangedEvents);
} else {
assertResults(cmds, REJECTED_MISSING_OBJECT, OK);
assertRefs(
"refs/heads/master", A,
"refs/heads/foo2", B);
- assertEquals(2, refsChangedEvents);
}
}
@Test
+ public void updateToMissingObjectRefsChangedEvents() throws IOException {
+ writeLooseRef("refs/heads/master", A);
+ refdir.exactRef("refs/heads/master");
+ int initialRefsChangedEvents = refsChangedEvents;
+
+ ObjectId bad = ObjectId
+ .fromString("deadbeefdeadbeefdeadbeefdeadbeefdeadbeef");
+ List<ReceiveCommand> cmds = Arrays.asList(
+ new ReceiveCommand(A, bad, "refs/heads/master", UPDATE),
+ new ReceiveCommand(zeroId(), B, "refs/heads/foo2", CREATE));
+ execute(newBatchUpdate(cmds).setAllowNonFastForwards(true), false);
+
+ assertEquals(atomic ? initialRefsChangedEvents
+ : initialRefsChangedEvents + 1, refsChangedEvents);
+ }
+
+ @Test
public void addMissingObject() throws IOException {
writeLooseRef("refs/heads/master", A);
@@ -349,15 +443,30 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
if (atomic) {
assertResults(cmds, TRANSACTION_ABORTED, REJECTED_MISSING_OBJECT);
assertRefs("refs/heads/master", A);
- assertEquals(1, refsChangedEvents);
} else {
assertResults(cmds, OK, REJECTED_MISSING_OBJECT);
assertRefs("refs/heads/master", B);
- assertEquals(2, refsChangedEvents);
}
}
@Test
+ public void addMissingObjectRefsChangedEvents() throws IOException {
+ writeLooseRef("refs/heads/master", A);
+ refdir.exactRef("refs/heads/master");
+ int initialRefsChangedEvents = refsChangedEvents;
+
+ ObjectId bad = ObjectId
+ .fromString("deadbeefdeadbeefdeadbeefdeadbeefdeadbeef");
+ List<ReceiveCommand> cmds = Arrays.asList(
+ new ReceiveCommand(A, B, "refs/heads/master", UPDATE),
+ new ReceiveCommand(zeroId(), bad, "refs/heads/foo2", CREATE));
+ execute(newBatchUpdate(cmds).setAllowNonFastForwards(true), false);
+
+ assertEquals(atomic ? initialRefsChangedEvents
+ : initialRefsChangedEvents + 1, refsChangedEvents);
+ }
+
+ @Test
public void oneNonExistentRef() throws IOException {
List<ReceiveCommand> cmds = Arrays.asList(
new ReceiveCommand(A, B, "refs/heads/foo1", UPDATE),
@@ -387,17 +496,30 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
if (atomic) {
assertResults(cmds, LOCK_FAILURE, TRANSACTION_ABORTED);
assertRefs("refs/heads/master", A);
- assertEquals(1, refsChangedEvents);
} else {
assertResults(cmds, LOCK_FAILURE, OK);
assertRefs(
"refs/heads/master", A,
"refs/heads/foo2", B);
- assertEquals(2, refsChangedEvents);
}
}
@Test
+ public void oneRefWrongOldValueRefsChangedEvents() throws IOException {
+ writeLooseRef("refs/heads/master", A);
+ refdir.exactRef("refs/heads/master");
+ int initialRefsChangedEvents = refsChangedEvents;
+
+ List<ReceiveCommand> cmds = Arrays.asList(
+ new ReceiveCommand(B, B, "refs/heads/master", UPDATE),
+ new ReceiveCommand(zeroId(), B, "refs/heads/foo2", CREATE));
+ execute(newBatchUpdate(cmds).setAllowNonFastForwards(true));
+
+ assertEquals(atomic ? initialRefsChangedEvents
+ : initialRefsChangedEvents + 1, refsChangedEvents);
+ }
+
+ @Test
public void nonExistentRef() throws IOException {
writeLooseRef("refs/heads/master", A);
@@ -409,17 +531,31 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
if (atomic) {
assertResults(cmds, TRANSACTION_ABORTED, LOCK_FAILURE);
assertRefs("refs/heads/master", A);
- assertEquals(1, refsChangedEvents);
} else {
assertResults(cmds, OK, LOCK_FAILURE);
assertRefs("refs/heads/master", B);
- assertEquals(2, refsChangedEvents);
}
}
@Test
+ public void nonExistentRefRefsChangedEvents() throws IOException {
+ writeLooseRef("refs/heads/master", A);
+ refdir.exactRef("refs/heads/master");
+ int initialRefsChangedEvents = refsChangedEvents;
+
+ List<ReceiveCommand> cmds = Arrays.asList(
+ new ReceiveCommand(A, B, "refs/heads/master", UPDATE),
+ new ReceiveCommand(A, zeroId(), "refs/heads/foo2", DELETE));
+ execute(newBatchUpdate(cmds).setAllowNonFastForwards(true));
+
+ assertEquals(atomic ? initialRefsChangedEvents
+ : initialRefsChangedEvents + 1, refsChangedEvents);
+ }
+
+ @Test
public void noRefLog() throws IOException {
writeRef("refs/heads/master", A);
+ int initialRefsChangedEvents = refsChangedEvents;
Map<String, ReflogEntry> oldLogs =
getLastReflogs("refs/heads/master", "refs/heads/branch");
@@ -434,7 +570,8 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
assertRefs(
"refs/heads/master", B,
"refs/heads/branch", B);
- assertEquals(atomic ? 2 : 3, refsChangedEvents);
+ assertEquals(atomic ? initialRefsChangedEvents + 1
+ : initialRefsChangedEvents + 2, refsChangedEvents);
assertReflogUnchanged(oldLogs, "refs/heads/master");
assertReflogUnchanged(oldLogs, "refs/heads/branch");
}
@@ -443,6 +580,7 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
public void reflogDefaultIdent() throws IOException {
writeRef("refs/heads/master", A);
writeRef("refs/heads/branch2", A);
+ int initialRefsChangedEvents = refsChangedEvents;
Map<String, ReflogEntry> oldLogs = getLastReflogs(
"refs/heads/master", "refs/heads/branch1", "refs/heads/branch2");
@@ -459,7 +597,8 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
"refs/heads/master", B,
"refs/heads/branch1", B,
"refs/heads/branch2", A);
- assertEquals(atomic ? 3 : 4, refsChangedEvents);
+ assertEquals(atomic ? initialRefsChangedEvents + 1
+ : initialRefsChangedEvents + 2, refsChangedEvents);
assertReflogEquals(
reflog(A, B, new PersonIdent(diskRepo), "a reflog"),
getLastReflog("refs/heads/master"));
@@ -473,6 +612,7 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
public void reflogAppendStatusNoMessage() throws IOException {
writeRef("refs/heads/master", A);
writeRef("refs/heads/branch1", B);
+ int initialRefsChangedEvents = refsChangedEvents;
List<ReceiveCommand> cmds = Arrays.asList(
new ReceiveCommand(A, B, "refs/heads/master", UPDATE),
@@ -488,7 +628,9 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
"refs/heads/master", B,
"refs/heads/branch1", A,
"refs/heads/branch2", A);
- assertEquals(atomic ? 3 : 5, refsChangedEvents);
+ assertEquals(atomic ? initialRefsChangedEvents + 1
+ : initialRefsChangedEvents + 3,
+ refsChangedEvents);
assertReflogEquals(
// Always forced; setAllowNonFastForwards(true) bypasses the check.
reflog(A, B, new PersonIdent(diskRepo), "forced-update"),
@@ -504,6 +646,7 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
@Test
public void reflogAppendStatusFastForward() throws IOException {
writeRef("refs/heads/master", A);
+ int initialRefsChangedEvents = refsChangedEvents;
List<ReceiveCommand> cmds = Arrays.asList(
new ReceiveCommand(A, B, "refs/heads/master", UPDATE));
@@ -511,7 +654,7 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
assertResults(cmds, OK);
assertRefs("refs/heads/master", B);
- assertEquals(2, refsChangedEvents);
+ assertEquals(initialRefsChangedEvents + 1, refsChangedEvents);
assertReflogEquals(
reflog(A, B, new PersonIdent(diskRepo), "fast-forward"),
getLastReflog("refs/heads/master"));
@@ -520,6 +663,7 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
@Test
public void reflogAppendStatusWithMessage() throws IOException {
writeRef("refs/heads/master", A);
+ int initialRefsChangedEvents = refsChangedEvents;
List<ReceiveCommand> cmds = Arrays.asList(
new ReceiveCommand(A, B, "refs/heads/master", UPDATE),
@@ -530,7 +674,8 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
assertRefs(
"refs/heads/master", B,
"refs/heads/branch", A);
- assertEquals(atomic ? 2 : 3, refsChangedEvents);
+ assertEquals(atomic ? initialRefsChangedEvents + 1
+ : initialRefsChangedEvents + 2, refsChangedEvents);
assertReflogEquals(
reflog(A, B, new PersonIdent(diskRepo), "a reflog: fast-forward"),
getLastReflog("refs/heads/master"));
@@ -542,6 +687,7 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
@Test
public void reflogCustomIdent() throws IOException {
writeRef("refs/heads/master", A);
+ int initialRefsChangedEvents = refsChangedEvents;
List<ReceiveCommand> cmds = Arrays.asList(
new ReceiveCommand(A, B, "refs/heads/master", UPDATE),
@@ -553,7 +699,8 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
.setRefLogIdent(ident));
assertResults(cmds, OK, OK);
- assertEquals(atomic ? 2 : 3, refsChangedEvents);
+ assertEquals(atomic ? initialRefsChangedEvents + 1
+ : initialRefsChangedEvents + 2, refsChangedEvents);
assertRefs(
"refs/heads/master", B,
"refs/heads/branch", B);
@@ -571,6 +718,8 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
public void reflogDelete() throws IOException {
writeRef("refs/heads/master", A);
writeRef("refs/heads/branch", A);
+ int initialRefsChangedEvents = refsChangedEvents;
+
assertEquals(
2, getLastReflogs("refs/heads/master", "refs/heads/branch").size());
@@ -581,7 +730,8 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
assertResults(cmds, OK, OK);
assertRefs("refs/heads/branch", B);
- assertEquals(atomic ? 3 : 4, refsChangedEvents);
+ assertEquals(atomic ? initialRefsChangedEvents + 1
+ : initialRefsChangedEvents + 2, refsChangedEvents);
assertNull(getLastReflog("refs/heads/master"));
assertReflogEquals(
reflog(A, B, new PersonIdent(diskRepo), "a reflog"),
@@ -591,6 +741,7 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
@Test
public void reflogFileDirectoryConflict() throws IOException {
writeRef("refs/heads/master", A);
+ int initialRefsChangedEvents = refsChangedEvents;
List<ReceiveCommand> cmds = Arrays.asList(
new ReceiveCommand(A, zeroId(), "refs/heads/master", DELETE),
@@ -599,7 +750,8 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
assertResults(cmds, OK, OK);
assertRefs("refs/heads/master/x", A);
- assertEquals(atomic ? 2 : 3, refsChangedEvents);
+ assertEquals(atomic ? initialRefsChangedEvents + 1
+ : initialRefsChangedEvents + 2, refsChangedEvents);
assertNull(getLastReflog("refs/heads/master"));
assertReflogEquals(
reflog(zeroId(), A, new PersonIdent(diskRepo), "a reflog"),
@@ -609,6 +761,7 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
@Test
public void reflogOnLockFailure() throws IOException {
writeRef("refs/heads/master", A);
+ int initialRefsChangedEvents = refsChangedEvents;
Map<String, ReflogEntry> oldLogs =
getLastReflogs("refs/heads/master", "refs/heads/branch");
@@ -620,12 +773,12 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
if (atomic) {
assertResults(cmds, TRANSACTION_ABORTED, LOCK_FAILURE);
- assertEquals(1, refsChangedEvents);
+ assertEquals(initialRefsChangedEvents, refsChangedEvents);
assertReflogUnchanged(oldLogs, "refs/heads/master");
assertReflogUnchanged(oldLogs, "refs/heads/branch");
} else {
assertResults(cmds, OK, LOCK_FAILURE);
- assertEquals(2, refsChangedEvents);
+ assertEquals(initialRefsChangedEvents + 1, refsChangedEvents);
assertReflogEquals(
reflog(A, B, new PersonIdent(diskRepo), "a reflog"),
getLastReflog("refs/heads/master"));
@@ -636,6 +789,7 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
@Test
public void overrideRefLogMessage() throws Exception {
writeRef("refs/heads/master", A);
+ int initialRefsChangedEvents = refsChangedEvents;
List<ReceiveCommand> cmds = Arrays.asList(
new ReceiveCommand(A, B, "refs/heads/master", UPDATE),
@@ -648,7 +802,8 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
.setRefLogMessage("a reflog", true));
assertResults(cmds, OK, OK);
- assertEquals(atomic ? 2 : 3, refsChangedEvents);
+ assertEquals(atomic ? initialRefsChangedEvents + 1
+ : initialRefsChangedEvents + 2, refsChangedEvents);
assertReflogEquals(
reflog(A, B, ident, "custom log"),
getLastReflog("refs/heads/master"),
@@ -662,6 +817,7 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
@Test
public void overrideDisableRefLog() throws Exception {
writeRef("refs/heads/master", A);
+ int initialRefsChangedEvents = refsChangedEvents;
Map<String, ReflogEntry> oldLogs =
getLastReflogs("refs/heads/master", "refs/heads/branch");
@@ -673,7 +829,8 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
execute(newBatchUpdate(cmds).setRefLogMessage("a reflog", true));
assertResults(cmds, OK, OK);
- assertEquals(atomic ? 2 : 3, refsChangedEvents);
+ assertEquals(atomic ? initialRefsChangedEvents + 1
+ : initialRefsChangedEvents + 2, refsChangedEvents);
assertReflogUnchanged(oldLogs, "refs/heads/master");
assertReflogEquals(
reflog(zeroId(), B, new PersonIdent(diskRepo), "a reflog: created"),
@@ -763,14 +920,12 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
if (atomic) {
assertResults(cmds, LOCK_FAILURE, TRANSACTION_ABORTED);
assertRefs("refs/heads/master", A);
- assertEquals(1, refsChangedEvents);
} else {
// Only operates on loose refs, doesn't care that packed-refs is locked.
assertResults(cmds, OK, OK);
assertRefs(
"refs/heads/master", B,
"refs/heads/branch", B);
- assertEquals(3, refsChangedEvents);
}
} finally {
myLock.unlock();
@@ -778,6 +933,29 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
}
@Test
+ public void packedRefsLockFailureRefsChangedEvents() throws Exception {
+ writeLooseRef("refs/heads/master", A);
+ refdir.exactRef("refs/heads/master");
+ int initialRefsChangedEvents = refsChangedEvents;
+
+ List<ReceiveCommand> cmds = Arrays.asList(
+ new ReceiveCommand(A, B, "refs/heads/master", UPDATE),
+ new ReceiveCommand(zeroId(), B, "refs/heads/branch", CREATE));
+
+ LockFile myLock = refdir.lockPackedRefs();
+ try {
+ execute(newBatchUpdate(cmds).setAllowNonFastForwards(true));
+
+ assertEquals(
+ atomic ? initialRefsChangedEvents
+ : initialRefsChangedEvents + 2,
+ refsChangedEvents);
+ } finally {
+ myLock.unlock();
+ }
+ }
+
+ @Test
public void oneRefLockFailure() throws Exception {
writeLooseRef("refs/heads/master", A);
@@ -796,13 +974,11 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
if (atomic) {
assertResults(cmds, TRANSACTION_ABORTED, LOCK_FAILURE);
assertRefs("refs/heads/master", A);
- assertEquals(1, refsChangedEvents);
} else {
assertResults(cmds, OK, LOCK_FAILURE);
assertRefs(
"refs/heads/branch", B,
"refs/heads/master", A);
- assertEquals(2, refsChangedEvents);
}
} finally {
myLock.unlock();
@@ -810,6 +986,30 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
}
@Test
+ public void oneRefLockFailureRefsChangedEvents() throws Exception {
+ writeLooseRef("refs/heads/master", A);
+ refdir.exactRef("refs/heads/master");
+ int initialRefsChangedEvents = refsChangedEvents;
+
+ List<ReceiveCommand> cmds = Arrays.asList(
+ new ReceiveCommand(zeroId(), B, "refs/heads/branch", CREATE),
+ new ReceiveCommand(A, B, "refs/heads/master", UPDATE));
+
+ LockFile myLock = new LockFile(refdir.fileFor("refs/heads/master"));
+ assertTrue(myLock.lock());
+ try {
+ execute(newBatchUpdate(cmds).setAllowNonFastForwards(true));
+
+ assertEquals(
+ atomic ? initialRefsChangedEvents
+ : initialRefsChangedEvents + 1,
+ refsChangedEvents);
+ } finally {
+ myLock.unlock();
+ }
+ }
+
+ @Test
public void singleRefUpdateDoesNotRequirePackedRefsLock() throws Exception {
writeLooseRef("refs/heads/master", A);
@@ -822,7 +1022,6 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
assertFalse(getLockFile("refs/heads/master").exists());
assertResults(cmds, OK);
- assertEquals(2, refsChangedEvents);
assertRefs("refs/heads/master", B);
} finally {
myLock.unlock();
@@ -830,6 +1029,26 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
}
@Test
+ public void singleRefUpdateDoesNotRequirePackedRefsLockRefsChangedEvents()
+ throws Exception {
+ writeLooseRef("refs/heads/master", A);
+ refdir.exactRef("refs/heads/master");
+ int initialRefsChangedEvents = refsChangedEvents;
+
+ List<ReceiveCommand> cmds = Arrays
+ .asList(new ReceiveCommand(A, B, "refs/heads/master", UPDATE));
+
+ LockFile myLock = refdir.lockPackedRefs();
+ try {
+ execute(newBatchUpdate(cmds).setAllowNonFastForwards(true));
+
+ assertEquals(initialRefsChangedEvents + 1, refsChangedEvents);
+ } finally {
+ myLock.unlock();
+ }
+ }
+
+ @Test
public void atomicUpdateRespectsInProcessLock() throws Exception {
assumeTrue(atomic);
@@ -881,6 +1100,53 @@ public class BatchRefUpdateTest extends LocalDiskRepositoryTestCase {
"refs/heads/branch", B);
}
+ @Test
+ public void atomicUpdateRespectsInProcessLockRefsChangedEvents()
+ throws Exception {
+ assumeTrue(atomic);
+
+ writeLooseRef("refs/heads/master", A);
+ refdir.exactRef("refs/heads/master");
+ int initialRefsChangedEvents = refsChangedEvents;
+
+ List<ReceiveCommand> cmds = Arrays.asList(
+ new ReceiveCommand(A, B, "refs/heads/master", UPDATE),
+ new ReceiveCommand(zeroId(), B, "refs/heads/branch", CREATE));
+
+ Thread t = new Thread(() -> {
+ try {
+ execute(newBatchUpdate(cmds).setAllowNonFastForwards(true));
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ });
+
+ ReentrantLock l = refdir.inProcessPackedRefsLock;
+ l.lock();
+ try {
+ t.start();
+ long timeoutSecs = 10;
+
+ // Hold onto the lock until we observe the worker thread has
+ // attempted to
+ // acquire it.
+ while (l.getQueueLength() == 0) {
+ Thread.sleep(3);
+ }
+
+ // Once we unlock, the worker thread should finish the update
+ // promptly.
+ l.unlock();
+ t.join(SECONDS.toMillis(timeoutSecs));
+ } finally {
+ if (l.isHeldByCurrentThread()) {
+ l.unlock();
+ }
+ }
+
+ assertEquals(initialRefsChangedEvents + 1, refsChangedEvents);
+ }
+
private void setLogAllRefUpdates(boolean enable) throws Exception {
StoredConfig cfg = diskRepo.getConfig();
cfg.load();
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcOrphanFilesTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcOrphanFilesTest.java
index 79d72c56d0..e54c4ad458 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcOrphanFilesTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcOrphanFilesTest.java
@@ -57,11 +57,15 @@ public class GcOrphanFilesTest extends GcTestCase {
private final static String BITMAP_File_1 = PACK + "-1.bitmap";
- private final static String IDX_File_2 = PACK + "-2.idx";
+ private static final String BITMAP_File_2 = PACK + "-2.bitmap";
+
+ private static final String IDX_File_2 = PACK + "-2.idx";
private final static String IDX_File_malformed = PACK + "-1234idx";
- private final static String PACK_File_2 = PACK + "-2.pack";
+ private static final String KEEP_File_2 = PACK + "-2.keep";
+
+ private static final String PACK_File_2 = PACK + "-2.pack";
private final static String PACK_File_3 = PACK + "-3.pack";
@@ -105,6 +109,22 @@ public class GcOrphanFilesTest extends GcTestCase {
assertTrue(new File(packDir, IDX_File_malformed).exists());
}
+ @Test
+ public void keepPreventsDeletionOfIndexFilesForMissingPackFile()
+ throws Exception {
+ createFileInPackFolder(BITMAP_File_1);
+ createFileInPackFolder(IDX_File_2);
+ createFileInPackFolder(BITMAP_File_2);
+ createFileInPackFolder(KEEP_File_2);
+ createFileInPackFolder(PACK_File_3);
+ gc.gc();
+ assertFalse(new File(packDir, BITMAP_File_1).exists());
+ assertTrue(new File(packDir, BITMAP_File_2).exists());
+ assertTrue(new File(packDir, IDX_File_2).exists());
+ assertTrue(new File(packDir, KEEP_File_2).exists());
+ assertTrue(new File(packDir, PACK_File_3).exists());
+ }
+
private void createFileInPackFolder(String fileName) throws IOException {
if (!packDir.exists() || !packDir.isDirectory()) {
assertTrue(packDir.mkdirs());
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/WindowCacheGetTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/WindowCacheGetTest.java
index 9063b65189..a173532db1 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/WindowCacheGetTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/WindowCacheGetTest.java
@@ -53,6 +53,8 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
import java.util.List;
import org.eclipse.jgit.errors.CorruptObjectException;
@@ -61,13 +63,30 @@ import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectLoader;
import org.eclipse.jgit.storage.file.WindowCacheConfig;
+import org.eclipse.jgit.storage.file.WindowCacheStats;
import org.eclipse.jgit.test.resources.SampleDataRepositoryTestCase;
import org.eclipse.jgit.util.MutableInteger;
import org.junit.Before;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+@RunWith(Parameterized.class)
public class WindowCacheGetTest extends SampleDataRepositoryTestCase {
private List<TestObject> toLoad;
+ private WindowCacheConfig cfg;
+ private boolean useStrongRefs;
+
+ @Parameters(name = "useStrongRefs={0}")
+ public static Collection<Object[]> data() {
+ return Arrays
+ .asList(new Object[][] { { Boolean.TRUE }, { Boolean.FALSE } });
+ }
+
+ public WindowCacheGetTest(Boolean useStrongRef) {
+ this.useStrongRefs = useStrongRef.booleanValue();
+ }
@Override
@Before
@@ -92,23 +111,36 @@ public class WindowCacheGetTest extends SampleDataRepositoryTestCase {
}
}
assertEquals(96, toLoad.size());
+ cfg = new WindowCacheConfig();
+ cfg.setPackedGitUseStrongRefs(useStrongRefs);
}
@Test
public void testCache_Defaults() throws IOException {
- WindowCacheConfig cfg = new WindowCacheConfig();
cfg.install();
doCacheTests();
checkLimits(cfg);
final WindowCache cache = WindowCache.getInstance();
- assertEquals(6, cache.getOpenFiles());
- assertEquals(17346, cache.getOpenBytes());
+ WindowCacheStats s = cache.getStats();
+ assertEquals(6, s.getOpenFileCount());
+ assertEquals(17346, s.getOpenByteCount());
+ assertEquals(0, s.getEvictionCount());
+ assertEquals(90, s.getHitCount());
+ assertTrue(s.getHitRatio() > 0.0 && s.getHitRatio() < 1.0);
+ assertEquals(6, s.getLoadCount());
+ assertEquals(0, s.getLoadFailureCount());
+ assertEquals(0, s.getLoadFailureRatio(), 0.001);
+ assertEquals(6, s.getLoadSuccessCount());
+ assertEquals(6, s.getMissCount());
+ assertTrue(s.getMissRatio() > 0.0 && s.getMissRatio() < 1.0);
+ assertEquals(96, s.getRequestCount());
+ assertTrue(s.getAverageLoadTime() > 0.0);
+ assertTrue(s.getTotalLoadTime() > 0.0);
}
@Test
public void testCache_TooFewFiles() throws IOException {
- final WindowCacheConfig cfg = new WindowCacheConfig();
cfg.setPackedGitOpenFiles(2);
cfg.install();
doCacheTests();
@@ -117,7 +149,6 @@ public class WindowCacheGetTest extends SampleDataRepositoryTestCase {
@Test
public void testCache_TooSmallLimit() throws IOException {
- final WindowCacheConfig cfg = new WindowCacheConfig();
cfg.setPackedGitWindowSize(4096);
cfg.setPackedGitLimit(4096);
cfg.install();
@@ -127,10 +158,32 @@ public class WindowCacheGetTest extends SampleDataRepositoryTestCase {
private static void checkLimits(WindowCacheConfig cfg) {
final WindowCache cache = WindowCache.getInstance();
- assertTrue(cache.getOpenFiles() <= cfg.getPackedGitOpenFiles());
- assertTrue(cache.getOpenBytes() <= cfg.getPackedGitLimit());
- assertTrue(0 < cache.getOpenFiles());
- assertTrue(0 < cache.getOpenBytes());
+ WindowCacheStats s = cache.getStats();
+ assertTrue("average load time should be > 0",
+ 0 < s.getAverageLoadTime());
+ assertTrue("open byte count should be > 0", 0 < s.getOpenByteCount());
+ assertTrue("eviction count should be >= 0", 0 <= s.getEvictionCount());
+ assertTrue("hit count should be > 0", 0 < s.getHitCount());
+ assertTrue("hit ratio should be > 0", 0 < s.getHitRatio());
+ assertTrue("hit ratio should be < 1", 1 > s.getHitRatio());
+ assertTrue("load count should be > 0", 0 < s.getLoadCount());
+ assertTrue("load failure count should be >= 0",
+ 0 <= s.getLoadFailureCount());
+ assertTrue("load failure ratio should be >= 0",
+ 0.0 <= s.getLoadFailureRatio());
+ assertTrue("load failure ratio should be < 1",
+ 1 > s.getLoadFailureRatio());
+ assertTrue("load success count should be > 0",
+ 0 < s.getLoadSuccessCount());
+ assertTrue("open byte count should be <= core.packedGitLimit",
+ s.getOpenByteCount() <= cfg.getPackedGitLimit());
+ assertTrue("open file count should be <= core.packedGitOpenFiles",
+ s.getOpenFileCount() <= cfg.getPackedGitOpenFiles());
+ assertTrue("miss success count should be >= 0", 0 <= s.getMissCount());
+ assertTrue("miss ratio should be > 0", 0 <= s.getMissRatio());
+ assertTrue("miss ratio should be < 1", 1 > s.getMissRatio());
+ assertTrue("request count should be > 0", 0 < s.getRequestCount());
+ assertTrue("total load time should be > 0", 0 < s.getTotalLoadTime());
}
private void doCacheTests() throws IOException {
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/transport/http/NetscapeCookieFileTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/transport/http/NetscapeCookieFileTest.java
index 0a3f89e238..e9c7f9aee0 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/transport/http/NetscapeCookieFileTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/transport/http/NetscapeCookieFileTest.java
@@ -60,7 +60,6 @@ import java.util.Set;
import java.util.regex.Pattern;
import org.eclipse.jgit.internal.storage.file.LockFile;
-import org.eclipse.jgit.internal.transport.http.NetscapeCookieFile;
import org.eclipse.jgit.util.http.HttpCookiesMatcher;
import org.hamcrest.CoreMatchers;
import org.junit.Assert;
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/FileBasedConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/FileBasedConfigTest.java
index 5100d258d7..8b9869ae4a 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/FileBasedConfigTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/FileBasedConfigTest.java
@@ -46,6 +46,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
import static org.eclipse.jgit.util.FileUtils.pathToString;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -54,6 +55,8 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import java.util.StringTokenizer;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
import org.eclipse.jgit.errors.ConfigInvalidException;
import org.eclipse.jgit.junit.MockSystemReader;
@@ -90,11 +93,13 @@ public class FileBasedConfigTest {
private Path trash;
+ private MockSystemReader mockSystemReader;
+
@Before
public void setUp() throws Exception {
- SystemReader.setInstance(new MockSystemReader());
+ mockSystemReader = new MockSystemReader();
+ SystemReader.setInstance(mockSystemReader);
trash = Files.createTempDirectory("tmp_");
- FS.getFileStoreAttributes(trash.getParent());
}
@After
@@ -298,6 +303,37 @@ public class FileBasedConfigTest {
assertEquals(ALICE_EMAIL, config.getString(USER, null, EMAIL));
}
+ @Test
+ public void testSavedConfigFileShouldNotReadUserGitConfig()
+ throws IOException {
+ AtomicBoolean userConfigTimeRead = new AtomicBoolean(false);
+
+ Path userConfigFile = createFile(CONTENT1.getBytes(), "home");
+ mockSystemReader.setUserGitConfig(
+ new FileBasedConfig(userConfigFile.toFile(), FS.DETECTED) {
+
+ @Override
+ public long getTimeUnit(String section, String subsection,
+ String name, long defaultValue, TimeUnit wantUnit) {
+ userConfigTimeRead.set(true);
+ return super.getTimeUnit(section, subsection, name,
+ defaultValue, wantUnit);
+ }
+ });
+
+ Path file = createFile(CONTENT2.getBytes(), "repo");
+ FileBasedConfig fileBasedConfig = new FileBasedConfig(file.toFile(),
+ FS.DETECTED);
+ fileBasedConfig.save();
+
+ // Needed to trigger the read of FileSnapshot filesystem settings
+ fileBasedConfig.isOutdated();
+ assertFalse(
+ "User config should not be read when accessing config files "
+ + "for avoiding deadlocks",
+ userConfigTimeRead.get());
+ }
+
private Path createFile(byte[] content) throws IOException {
return createFile(content, null);
}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/StatsTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/StatsTest.java
index 8b253828c4..0303bb4f7c 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/StatsTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/StatsTest.java
@@ -45,7 +45,6 @@ package org.eclipse.jgit.util;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import org.eclipse.jgit.util.Stats;
import org.junit.Test;
public class StatsTest {
diff --git a/org.eclipse.jgit/.settings/.api_filters b/org.eclipse.jgit/.settings/.api_filters
index 842fc873d4..574ed4d258 100644
--- a/org.eclipse.jgit/.settings/.api_filters
+++ b/org.eclipse.jgit/.settings/.api_filters
@@ -37,6 +37,42 @@
<resource path="src/org/eclipse/jgit/lib/ConfigConstants.java" type="org.eclipse.jgit.lib.ConfigConstants">
<filter id="1142947843">
<message_arguments>
+ <message_argument value="5.1.13"/>
+ <message_argument value="CONFIG_JMX_SECTION"/>
+ </message_arguments>
+ </filter>
+ <filter id="1142947843">
+ <message_arguments>
+ <message_argument value="5.1.13"/>
+ <message_argument value="CONFIG_KEY_PACKED_GIT_LIMIT"/>
+ </message_arguments>
+ </filter>
+ <filter id="1142947843">
+ <message_arguments>
+ <message_argument value="5.1.13"/>
+ <message_argument value="CONFIG_KEY_PACKED_GIT_MMAP"/>
+ </message_arguments>
+ </filter>
+ <filter id="1142947843">
+ <message_arguments>
+ <message_argument value="5.1.13"/>
+ <message_argument value="CONFIG_KEY_PACKED_GIT_OPENFILES"/>
+ </message_arguments>
+ </filter>
+ <filter id="1142947843">
+ <message_arguments>
+ <message_argument value="5.1.13"/>
+ <message_argument value="CONFIG_KEY_PACKED_GIT_USE_STRONGREFS"/>
+ </message_arguments>
+ </filter>
+ <filter id="1142947843">
+ <message_arguments>
+ <message_argument value="5.1.13"/>
+ <message_argument value="CONFIG_KEY_PACKED_GIT_WINDOWSIZE"/>
+ </message_arguments>
+ </filter>
+ <filter id="1142947843">
+ <message_arguments>
<message_argument value="5.1.9"/>
<message_argument value="CONFIG_FILESYSTEM_SECTION"/>
</message_arguments>
@@ -78,6 +114,29 @@
</message_arguments>
</filter>
</resource>
+ <resource path="src/org/eclipse/jgit/storage/file/WindowCacheConfig.java" type="org.eclipse.jgit.storage.file.WindowCacheConfig">
+ <filter id="1142947843">
+ <message_arguments>
+ <message_argument value="5.1.13"/>
+ <message_argument value="isPackedGitUseStrongRefs()"/>
+ </message_arguments>
+ </filter>
+ <filter id="1142947843">
+ <message_arguments>
+ <message_argument value="5.1.13"/>
+ <message_argument value="setPackedGitUseStrongRefs(boolean)"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/jgit/storage/file/WindowCacheStats.java" type="org.eclipse.jgit.storage.file.WindowCacheStats">
+ <filter id="337809484">
+ <message_arguments>
+ <message_argument value="org.eclipse.jgit.storage.file.WindowCacheStats"/>
+ <message_argument value="4"/>
+ <message_argument value="8"/>
+ </message_arguments>
+ </filter>
+ </resource>
<resource path="src/org/eclipse/jgit/storage/pack/PackConfig.java" type="org.eclipse.jgit.storage.pack.PackConfig">
<filter id="336658481">
<message_arguments>
@@ -184,6 +243,14 @@
</message_arguments>
</filter>
</resource>
+ <resource path="src/org/eclipse/jgit/treewalk/FileTreeIterator.java" type="org.eclipse.jgit.treewalk.FileTreeIterator$FileEntry">
+ <filter id="1142947843">
+ <message_arguments>
+ <message_argument value="5.1.9"/>
+ <message_argument value="getLastModifiedInstant()"/>
+ </message_arguments>
+ </filter>
+ </resource>
<resource path="src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java" type="org.eclipse.jgit.treewalk.WorkingTreeIterator">
<filter id="1142947843">
<message_arguments>
@@ -282,6 +349,14 @@
</message_arguments>
</filter>
</resource>
+ <resource path="src/org/eclipse/jgit/util/Monitoring.java" type="org.eclipse.jgit.util.Monitoring">
+ <filter id="1109393411">
+ <message_arguments>
+ <message_argument value="5.1.13"/>
+ <message_argument value="org.eclipse.jgit.util.Monitoring"/>
+ </message_arguments>
+ </filter>
+ </resource>
<resource path="src/org/eclipse/jgit/util/SimpleLruCache.java" type="org.eclipse.jgit.util.SimpleLruCache">
<filter id="1109393411">
<message_arguments>
diff --git a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
index 049888272b..8890c9fa60 100644
--- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
+++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
@@ -210,6 +210,7 @@ deepenNotWithDeepen=Cannot combine deepen with deepen-not
deepenSinceWithDeepen=Cannot combine deepen with deepen-since
deleteBranchUnexpectedResult=Delete branch returned unexpected result {0}
deleteFileFailed=Could not delete file {0}
+deletedOrphanInPackDir=Deleted orphaned file {}
deleteRequiresZeroNewId=Delete requires new ID to be zero
deleteTagUnexpectedResult=Delete tag returned unexpected result {0}
deletingNotSupported=Deleting {0} not supported.
@@ -364,7 +365,7 @@ invalidPacketLineHeader=Invalid packet line header: {0}
invalidPath=Invalid path: {0}
invalidPurgeFactor=Invalid purgeFactor {0}, values have to be in range between 0 and 1
invalidRedirectLocation=Invalid redirect location {0} -> {1}
-invalidRefAdvertisementLine=Invalid ref advertisement line: ''{1}''
+invalidRefAdvertisementLine=Invalid ref advertisement line: ''{0}''
invalidReflogRevision=Invalid reflog revision: {0}
invalidRefName=Invalid ref name: {0}
invalidReftableBlock=Invalid reftable block
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
index 60d1dab23f..01c8b3782a 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
@@ -271,6 +271,7 @@ public class JGitText extends TranslationBundle {
/***/ public String deepenSinceWithDeepen;
/***/ public String deleteBranchUnexpectedResult;
/***/ public String deleteFileFailed;
+ /***/ public String deletedOrphanInPackDir;
/***/ public String deleteRequiresZeroNewId;
/***/ public String deleteTagUnexpectedResult;
/***/ public String deletingNotSupported;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileSnapshot.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileSnapshot.java
index 8650ebfe29..93158f61da 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileSnapshot.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileSnapshot.java
@@ -218,6 +218,12 @@ public class FileSnapshot {
private FileStoreAttributes fileStoreAttributeCache;
/**
+ * if {@code true} read filesystem time resolution from configuration file
+ * otherwise use fallback resolution
+ */
+ private boolean useConfig;
+
+ /**
* Object that uniquely identifies the given file, or {@code
* null} if a file key is not available
*/
@@ -253,9 +259,7 @@ public class FileSnapshot {
protected FileSnapshot(File file, boolean useConfig) {
this.file = file;
this.lastRead = Instant.now();
- this.fileStoreAttributeCache = useConfig
- ? FS.getFileStoreAttributes(file.toPath().getParent())
- : FALLBACK_FILESTORE_ATTRIBUTES;
+ this.useConfig = useConfig;
BasicFileAttributes fileAttributes = null;
try {
fileAttributes = FS.DETECTED.fileAttributes(file);
@@ -399,7 +403,7 @@ public class FileSnapshot {
* if sleep was interrupted
*/
public void waitUntilNotRacy() throws InterruptedException {
- long timestampResolution = fileStoreAttributeCache
+ long timestampResolution = fileStoreAttributeCache()
.getFsTimestampResolution().toNanos();
while (isRacyClean(Instant.now())) {
TimeUnit.NANOSECONDS.sleep(timestampResolution);
@@ -520,10 +524,10 @@ public class FileSnapshot {
}
private long getEffectiveRacyThreshold() {
- long timestampResolution = fileStoreAttributeCache
+ long timestampResolution = fileStoreAttributeCache()
.getFsTimestampResolution().toNanos();
- long minRacyInterval = fileStoreAttributeCache.getMinimalRacyInterval()
- .toNanos();
+ long minRacyInterval = fileStoreAttributeCache()
+ .getMinimalRacyInterval().toNanos();
long max = Math.max(timestampResolution, minRacyInterval);
// safety margin: factor 2.5 below 100ms otherwise 1.25
return max < 100_000_000L ? max * 5 / 2 : max * 5 / 4;
@@ -583,4 +587,13 @@ public class FileSnapshot {
}
return changed;
}
+
+ private FileStoreAttributes fileStoreAttributeCache() {
+ if (fileStoreAttributeCache == null) {
+ fileStoreAttributeCache = useConfig
+ ? FS.getFileStoreAttributes(file.toPath().getParent())
+ : FALLBACK_FILESTORE_ATTRIBUTES;
+ }
+ return fileStoreAttributeCache;
+ }
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java
index 08bb6cb7fa..0ff3f615bf 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java
@@ -148,6 +148,8 @@ public class GC {
private static final String INDEX_EXT = "." + PackExt.INDEX.getExtension(); //$NON-NLS-1$
+ private static final String KEEP_EXT = "." + PackExt.KEEP.getExtension(); //$NON-NLS-1$
+
private static final int DEFAULT_AUTOPACKLIMIT = 50;
private static final int DEFAULT_AUTOLIMIT = 6700;
@@ -978,11 +980,15 @@ public class GC {
fileNames = files.map(path -> path.getFileName().toString())
.filter(name -> (name.endsWith(PACK_EXT)
|| name.endsWith(BITMAP_EXT)
- || name.endsWith(INDEX_EXT)))
+ || name.endsWith(INDEX_EXT)
+ || name.endsWith(KEEP_EXT)))
+ // sort files with same base name in the order:
+ // .pack, .keep, .index, .bitmap to avoid look ahead
.sorted(Collections.reverseOrder())
.collect(Collectors.toList());
- } catch (IOException e1) {
- // ignore
+ } catch (IOException e) {
+ LOG.error(e.getMessage(), e);
+ return;
}
if (fileNames == null) {
return;
@@ -990,12 +996,14 @@ public class GC {
String base = null;
for (String n : fileNames) {
- if (n.endsWith(PACK_EXT)) {
+ if (n.endsWith(PACK_EXT) || n.endsWith(KEEP_EXT)) {
base = n.substring(0, n.lastIndexOf('.'));
} else {
if (base == null || !n.startsWith(base)) {
try {
- Files.delete(packDir.resolve(n));
+ Path delete = packDir.resolve(n);
+ Files.delete(delete);
+ LOG.warn(JGitText.get().deletedOrphanInPackDir, delete);
} catch (IOException e) {
LOG.error(e.getMessage(), e);
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java
index 6af41256d6..eda4da8e90 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java
@@ -133,6 +133,8 @@ public class LockFile {
private boolean needSnapshot;
+ private boolean snapshotNoConfig;
+
boolean fsync;
private FileSnapshot commitSnapshot;
@@ -385,6 +387,21 @@ public class LockFile {
}
/**
+ * Request that {@link #commit()} remember the
+ * {@link org.eclipse.jgit.internal.storage.file.FileSnapshot} without using
+ * config file to get filesystem timestamp resolution.
+ * This method should be invoked before the file is accessed.
+ * It is used by FileBasedConfig to avoid endless recursion.
+ *
+ * @param on
+ * true if the commit method must remember the FileSnapshot.
+ */
+ public void setNeedSnapshotNoConfig(boolean on) {
+ needSnapshot = on;
+ snapshotNoConfig = on;
+ }
+
+ /**
* Request that {@link #commit()} force dirty data to the drive.
*
* @param on
@@ -460,8 +477,12 @@ public class LockFile {
}
private void saveStatInformation() {
- if (needSnapshot)
- commitSnapshot = FileSnapshot.save(lck);
+ if (needSnapshot) {
+ commitSnapshot = snapshotNoConfig ?
+ // don't use config in this snapshot to avoid endless recursion
+ FileSnapshot.saveNoConfig(lck)
+ : FileSnapshot.save(lck);
+ }
}
/**
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java
index 7d31673566..8fa683f5ee 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java
@@ -184,7 +184,7 @@ public class ObjectDirectoryPackParser extends PackParser {
String p = pack.getAbsolutePath();
String i = p.substring(0, p.length() - ".pack".length()) + ".idx"; //$NON-NLS-1$ //$NON-NLS-2$
File idx = new File(i);
- if (idx.exists() && idx.isFile())
+ if (idx.isFile())
size += idx.length();
return size;
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java
index 88e05af414..86e90c63c5 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java
@@ -684,6 +684,7 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> {
private void doOpen() throws IOException {
if (invalid) {
+ openFail(true, invalidatingCause);
throw new PackInvalidException(packFile, invalidatingCause);
}
try {
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 e5cea6c010..8cc9383fc6 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
@@ -277,47 +277,18 @@ public class RefDirectory extends RefDatabase {
/** {@inheritDoc} */
@Override
public boolean isNameConflicting(String name) throws IOException {
- RefList<Ref> packed = getPackedRefs();
- RefList<LooseRef> loose = getLooseRefs();
-
// Cannot be nested within an existing reference.
int lastSlash = name.lastIndexOf('/');
while (0 < lastSlash) {
String needle = name.substring(0, lastSlash);
- if (loose.contains(needle) || packed.contains(needle))
+ if (exactRef(needle) != null) {
return true;
+ }
lastSlash = name.lastIndexOf('/', lastSlash - 1);
}
// Cannot be the container of an existing reference.
- String prefix = name + '/';
- int idx;
-
- idx = -(packed.find(prefix) + 1);
- if (idx < packed.size() && packed.get(idx).getName().startsWith(prefix))
- return true;
-
- idx = -(loose.find(prefix) + 1);
- if (idx < loose.size() && loose.get(idx).getName().startsWith(prefix))
- return true;
-
- return false;
- }
-
- private RefList<LooseRef> getLooseRefs() {
- final RefList<LooseRef> oldLoose = looseRefs.get();
-
- LooseScanner scan = new LooseScanner(oldLoose);
- scan.scan(ALL);
-
- RefList<LooseRef> loose;
- if (scan.newLoose != null) {
- loose = scan.newLoose.toRefList();
- if (looseRefs.compareAndSet(oldLoose, loose))
- modCnt.incrementAndGet();
- } else
- loose = oldLoose;
- return loose;
+ return !getRefsByPrefix(name + '/').isEmpty();
}
@Nullable
@@ -1156,7 +1127,7 @@ public class RefDirectory extends RefDatabase {
try {
buf = IO.readSome(path, limit);
} catch (FileNotFoundException noFile) {
- if (path.exists() && path.isFile()) {
+ if (path.isFile()) {
throw noFile;
}
return null; // doesn't exist or no file; not a reference.
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCache.java
index da7250d141..838de0b336 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCache.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCache.java
@@ -47,14 +47,22 @@ package org.eclipse.jgit.internal.storage.file;
import java.io.IOException;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.SoftReference;
+import java.util.Collections;
+import java.util.Map;
import java.util.Random;
-import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReferenceArray;
+import java.util.concurrent.atomic.LongAdder;
import java.util.concurrent.locks.ReentrantLock;
+import java.util.stream.Collectors;
+import org.eclipse.jgit.annotations.NonNull;
import org.eclipse.jgit.internal.JGitText;
import org.eclipse.jgit.storage.file.WindowCacheConfig;
+import org.eclipse.jgit.storage.file.WindowCacheStats;
+import org.eclipse.jgit.util.Monitoring;
/**
* Caches slices of a {@link org.eclipse.jgit.internal.storage.file.PackFile} in
@@ -82,9 +90,16 @@ import org.eclipse.jgit.storage.file.WindowCacheConfig;
* comprised of roughly 10% of the cache, and evicting the oldest accessed entry
* within that window.
* <p>
- * Entities created by the cache are held under SoftReferences, permitting the
+ * Entities created by the cache are held under SoftReferences if option
+ * {@code core.packedGitUseStrongRefs} is set to {@code false} in the git config
+ * (this is the default) or by calling
+ * {@link WindowCacheConfig#setPackedGitUseStrongRefs(boolean)}, permitting the
* Java runtime's garbage collector to evict entries when heap memory gets low.
* Most JREs implement a loose least recently used algorithm for this eviction.
+ * When this option is set to {@code true} strong references are used which
+ * means that Java gc cannot evict the WindowCache to reclaim memory. On the
+ * other hand this provides more predictable performance since the cache isn't
+ * flushed when used heap comes close to the maximum heap size.
* <p>
* The internal hash table does not expand at runtime, instead it is fixed in
* size at cache creation time. The internal lock table used to gate load
@@ -101,19 +116,19 @@ import org.eclipse.jgit.storage.file.WindowCacheConfig;
* for a given <code>(PackFile,position)</code> tuple.</li>
* <li>For every <code>load()</code> invocation there is exactly one
* {@link #createRef(PackFile, long, ByteWindow)} invocation to wrap a
- * SoftReference around the cached entity.</li>
+ * SoftReference or a StrongReference around the cached entity.</li>
* <li>For every Reference created by <code>createRef()</code> there will be
- * exactly one call to {@link #clear(Ref)} to cleanup any resources associated
+ * exactly one call to {@link #clear(PageRef)} to cleanup any resources associated
* with the (now expired) cached entity.</li>
* </ul>
* <p>
* Therefore, it is safe to perform resource accounting increments during the
* {@link #load(PackFile, long)} or
* {@link #createRef(PackFile, long, ByteWindow)} methods, and matching
- * decrements during {@link #clear(Ref)}. Implementors may need to override
+ * decrements during {@link #clear(PageRef)}. Implementors may need to override
* {@link #createRef(PackFile, long, ByteWindow)} in order to embed additional
* accounting information into an implementation specific
- * {@link org.eclipse.jgit.internal.storage.file.WindowCache.Ref} subclass, as
+ * {@link org.eclipse.jgit.internal.storage.file.WindowCache.PageRef} subclass, as
* the cached entity may have already been evicted by the JRE's garbage
* collector.
* <p>
@@ -124,6 +139,225 @@ import org.eclipse.jgit.storage.file.WindowCacheConfig;
* other threads.
*/
public class WindowCache {
+
+ /**
+ * Record statistics for a cache
+ */
+ static interface StatsRecorder {
+ /**
+ * Record cache hits. Called when cache returns a cached entry.
+ *
+ * @param count
+ * number of cache hits to record
+ */
+ void recordHits(int count);
+
+ /**
+ * Record cache misses. Called when the cache returns an entry which had
+ * to be loaded.
+ *
+ * @param count
+ * number of cache misses to record
+ */
+ void recordMisses(int count);
+
+ /**
+ * Record a successful load of a cache entry
+ *
+ * @param loadTimeNanos
+ * time to load a cache entry
+ */
+ void recordLoadSuccess(long loadTimeNanos);
+
+ /**
+ * Record a failed load of a cache entry
+ *
+ * @param loadTimeNanos
+ * time used trying to load a cache entry
+ */
+ void recordLoadFailure(long loadTimeNanos);
+
+ /**
+ * Record cache evictions due to the cache evictions strategy
+ *
+ * @param count
+ * number of evictions to record
+ */
+ void recordEvictions(int count);
+
+ /**
+ * Record files opened by cache
+ *
+ * @param delta
+ * delta of number of files opened by cache
+ */
+ void recordOpenFiles(int delta);
+
+ /**
+ * Record cached bytes
+ *
+ * @param pack
+ * pack file the bytes are read from
+ *
+ * @param delta
+ * delta of cached bytes
+ */
+ void recordOpenBytes(PackFile pack, int delta);
+
+ /**
+ * Returns a snapshot of this recorder's stats. Note that this may be an
+ * inconsistent view, as it may be interleaved with update operations.
+ *
+ * @return a snapshot of this recorder's stats
+ */
+ @NonNull
+ WindowCacheStats getStats();
+ }
+
+ static class StatsRecorderImpl
+ implements StatsRecorder, WindowCacheStats {
+ private final LongAdder hitCount;
+ private final LongAdder missCount;
+ private final LongAdder loadSuccessCount;
+ private final LongAdder loadFailureCount;
+ private final LongAdder totalLoadTime;
+ private final LongAdder evictionCount;
+ private final LongAdder openFileCount;
+ private final LongAdder openByteCount;
+ private final Map<String, LongAdder> openByteCountPerRepository;
+
+ /**
+ * Constructs an instance with all counts initialized to zero.
+ */
+ public StatsRecorderImpl() {
+ hitCount = new LongAdder();
+ missCount = new LongAdder();
+ loadSuccessCount = new LongAdder();
+ loadFailureCount = new LongAdder();
+ totalLoadTime = new LongAdder();
+ evictionCount = new LongAdder();
+ openFileCount = new LongAdder();
+ openByteCount = new LongAdder();
+ openByteCountPerRepository = new ConcurrentHashMap<>();
+ }
+
+ @Override
+ public void recordHits(int count) {
+ hitCount.add(count);
+ }
+
+ @Override
+ public void recordMisses(int count) {
+ missCount.add(count);
+ }
+
+ @Override
+ public void recordLoadSuccess(long loadTimeNanos) {
+ loadSuccessCount.increment();
+ totalLoadTime.add(loadTimeNanos);
+ }
+
+ @Override
+ public void recordLoadFailure(long loadTimeNanos) {
+ loadFailureCount.increment();
+ totalLoadTime.add(loadTimeNanos);
+ }
+
+ @Override
+ public void recordEvictions(int count) {
+ evictionCount.add(count);
+ }
+
+ @Override
+ public void recordOpenFiles(int delta) {
+ openFileCount.add(delta);
+ }
+
+ @Override
+ public void recordOpenBytes(PackFile pack, int delta) {
+ openByteCount.add(delta);
+ String repositoryId = repositoryId(pack);
+ LongAdder la = openByteCountPerRepository
+ .computeIfAbsent(repositoryId, k -> new LongAdder());
+ la.add(delta);
+ if (delta < 0) {
+ openByteCountPerRepository.computeIfPresent(repositoryId,
+ (k, v) -> v.longValue() == 0 ? null : v);
+ }
+ }
+
+ private static String repositoryId(PackFile pack) {
+ // use repository's gitdir since packfile doesn't know its
+ // repository
+ return pack.getPackFile().getParentFile().getParentFile()
+ .getParent();
+ }
+
+ @Override
+ public WindowCacheStats getStats() {
+ return this;
+ }
+
+ @Override
+ public long getHitCount() {
+ return hitCount.sum();
+ }
+
+ @Override
+ public long getMissCount() {
+ return missCount.sum();
+ }
+
+ @Override
+ public long getLoadSuccessCount() {
+ return loadSuccessCount.sum();
+ }
+
+ @Override
+ public long getLoadFailureCount() {
+ return loadFailureCount.sum();
+ }
+
+ @Override
+ public long getEvictionCount() {
+ return evictionCount.sum();
+ }
+
+ @Override
+ public long getTotalLoadTime() {
+ return totalLoadTime.sum();
+ }
+
+ @Override
+ public long getOpenFileCount() {
+ return openFileCount.sum();
+ }
+
+ @Override
+ public long getOpenByteCount() {
+ return openByteCount.sum();
+ }
+
+ @Override
+ public void resetCounters() {
+ hitCount.reset();
+ missCount.reset();
+ loadSuccessCount.reset();
+ loadFailureCount.reset();
+ totalLoadTime.reset();
+ evictionCount.reset();
+ }
+
+ @Override
+ public Map<String, Long> getOpenByteCountPerRepository() {
+ return Collections.unmodifiableMap(
+ openByteCountPerRepository.entrySet().stream()
+ .collect(Collectors.toMap(Map.Entry::getKey,
+ e -> Long.valueOf(e.getValue().sum()),
+ (u, v) -> v)));
+ }
+ }
+
private static final int bits(int newSize) {
if (newSize < 4096)
throw new IllegalArgumentException(JGitText.get().invalidWindowSize);
@@ -197,8 +431,8 @@ public class WindowCache {
cache.removeAll(pack);
}
- /** ReferenceQueue to cleanup released and garbage collected windows. */
- private final ReferenceQueue<ByteWindow> queue;
+ /** cleanup released and/or garbage collected windows. */
+ private final CleanupQueue queue;
/** Number of entries in {@link #table}. */
private final int tableSize;
@@ -228,9 +462,11 @@ public class WindowCache {
private final int windowSize;
- private final AtomicInteger openFiles;
+ private final StatsRecorder statsRecorder;
- private final AtomicLong openBytes;
+ private final StatsRecorderImpl mbean;
+
+ private boolean useStrongRefs;
private WindowCache(WindowCacheConfig cfg) {
tableSize = tableSize(cfg);
@@ -240,7 +476,6 @@ public class WindowCache {
if (lockCount < 1)
throw new IllegalArgumentException(JGitText.get().lockCountMustBeGreaterOrEqual1);
- queue = new ReferenceQueue<>();
clock = new AtomicLong(1);
table = new AtomicReferenceArray<>(tableSize);
locks = new Lock[lockCount];
@@ -262,9 +497,13 @@ public class WindowCache {
mmap = cfg.isPackedGitMMAP();
windowSizeShift = bits(cfg.getPackedGitWindowSize());
windowSize = 1 << windowSizeShift;
+ useStrongRefs = cfg.isPackedGitUseStrongRefs();
+ queue = useStrongRefs ? new StrongCleanupQueue(this)
+ : new SoftCleanupQueue(this);
- openFiles = new AtomicInteger();
- openBytes = new AtomicLong();
+ mbean = new StatsRecorderImpl();
+ statsRecorder = mbean;
+ Monitoring.registerMBean(mbean, "block_cache"); //$NON-NLS-1$
if (maxFiles < 1)
throw new IllegalArgumentException(JGitText.get().openFilesMustBeAtLeast1);
@@ -273,55 +512,65 @@ public class WindowCache {
}
/**
- * @return the number of open files.
+ * @return cache statistics for the WindowCache
*/
- public int getOpenFiles() {
- return openFiles.get();
+ public WindowCacheStats getStats() {
+ return statsRecorder.getStats();
}
/**
- * @return the number of open bytes.
+ * Reset stats. Does not reset open bytes and open files stats.
*/
- public long getOpenBytes() {
- return openBytes.get();
+ public void resetStats() {
+ mbean.resetCounters();
}
private int hash(int packHash, long off) {
return packHash + (int) (off >>> windowSizeShift);
}
- private ByteWindow load(PackFile pack, long offset)
- throws IOException {
+ private ByteWindow load(PackFile pack, long offset) throws IOException {
+ long startTime = System.nanoTime();
if (pack.beginWindowCache())
- openFiles.incrementAndGet();
+ statsRecorder.recordOpenFiles(1);
try {
if (mmap)
return pack.mmap(offset, windowSize);
- return pack.read(offset, windowSize);
+ ByteArrayWindow w = pack.read(offset, windowSize);
+ statsRecorder.recordLoadSuccess(System.nanoTime() - startTime);
+ return w;
} catch (IOException | RuntimeException | Error e) {
close(pack);
+ statsRecorder.recordLoadFailure(System.nanoTime() - startTime);
throw e;
+ } finally {
+ statsRecorder.recordMisses(1);
}
}
- private Ref createRef(PackFile p, long o, ByteWindow v) {
- final Ref ref = new Ref(p, o, v, queue);
- openBytes.addAndGet(ref.size);
+ private PageRef<ByteWindow> createRef(PackFile p, long o, ByteWindow v) {
+ final PageRef<ByteWindow> ref = useStrongRefs
+ ? new StrongRef(p, o, v, queue)
+ : new SoftRef(p, o, v, (SoftCleanupQueue) queue);
+ statsRecorder.recordOpenBytes(ref.getPack(), ref.getSize());
return ref;
}
- private void clear(Ref ref) {
- openBytes.addAndGet(-ref.size);
- close(ref.pack);
+ private void clear(PageRef<ByteWindow> ref) {
+ statsRecorder.recordOpenBytes(ref.getPack(), -ref.getSize());
+ statsRecorder.recordEvictions(1);
+ close(ref.getPack());
}
private void close(PackFile pack) {
- if (pack.endWindowCache())
- openFiles.decrementAndGet();
+ if (pack.endWindowCache()) {
+ statsRecorder.recordOpenFiles(-1);
+ }
}
private boolean isFull() {
- return maxFiles < openFiles.get() || maxBytes < openBytes.get();
+ return maxFiles < mbean.getOpenFileCount()
+ || maxBytes < mbean.getOpenByteCount();
}
private long toStart(long offset) {
@@ -359,19 +608,23 @@ public class WindowCache {
final int slot = slot(pack, position);
final Entry e1 = table.get(slot);
ByteWindow v = scan(e1, pack, position);
- if (v != null)
+ if (v != null) {
+ statsRecorder.recordHits(1);
return v;
+ }
synchronized (lock(pack, position)) {
Entry e2 = table.get(slot);
if (e2 != e1) {
v = scan(e2, pack, position);
- if (v != null)
+ if (v != null) {
+ statsRecorder.recordHits(1);
return v;
+ }
}
v = load(pack, position);
- final Ref ref = createRef(pack, position, v);
+ final PageRef<ByteWindow> ref = createRef(pack, position, v);
hit(ref);
for (;;) {
final Entry n = new Entry(clean(e2), ref);
@@ -395,8 +648,8 @@ public class WindowCache {
private ByteWindow scan(Entry n, PackFile pack, long position) {
for (; n != null; n = n.next) {
- final Ref r = n.ref;
- if (r.pack == pack && r.position == position) {
+ final PageRef<ByteWindow> r = n.ref;
+ if (r.getPack() == pack && r.getPosition() == position) {
final ByteWindow v = r.get();
if (v != null) {
hit(r);
@@ -409,7 +662,7 @@ public class WindowCache {
return null;
}
- private void hit(Ref r) {
+ private void hit(PageRef r) {
// We don't need to be 100% accurate here. Its sufficient that at least
// one thread performs the increment. Any other concurrent access at
// exactly the same time can simply use the same clock value.
@@ -419,7 +672,7 @@ public class WindowCache {
//
final long c = clock.get();
clock.compareAndSet(c, c + 1);
- r.lastAccess = c;
+ r.setLastAccess(c);
}
private void evict() {
@@ -433,7 +686,8 @@ public class WindowCache {
for (Entry e = table.get(ptr); e != null; e = e.next) {
if (e.dead)
continue;
- if (old == null || e.ref.lastAccess < old.ref.lastAccess) {
+ if (old == null || e.ref.getLastAccess() < old.ref
+ .getLastAccess()) {
old = e;
slot = ptr;
}
@@ -453,7 +707,7 @@ public class WindowCache {
* <p>
* This is a last-ditch effort to clear out the cache, such as before it
* gets replaced by another cache that is configured differently. This
- * method tries to force every cached entry through {@link #clear(Ref)} to
+ * method tries to force every cached entry through {@link #clear(PageRef)} to
* ensure that resources are correctly accounted for and cleaned up by the
* subclass. A concurrent reader loading entries while this method is
* running may cause resource accounting failures.
@@ -486,7 +740,7 @@ public class WindowCache {
final Entry e1 = table.get(s);
boolean hasDead = false;
for (Entry e = e1; e != null; e = e.next) {
- if (e.ref.pack == pack) {
+ if (e.ref.getPack() == pack) {
e.kill();
hasDead = true;
} else if (e.dead)
@@ -499,20 +753,7 @@ public class WindowCache {
}
private void gc() {
- Ref r;
- while ((r = (Ref) queue.poll()) != null) {
- clear(r);
-
- final int s = slot(r.pack, r.position);
- final Entry e1 = table.get(s);
- for (Entry n = e1; n != null; n = n.next) {
- if (n.ref == r) {
- n.dead = true;
- table.compareAndSet(s, e1, clean(e1));
- break;
- }
- }
- }
+ queue.gc();
}
private int slot(PackFile pack, long position) {
@@ -525,7 +766,7 @@ public class WindowCache {
private static Entry clean(Entry top) {
while (top != null && top.dead) {
- top.ref.enqueue();
+ top.ref.kill();
top = top.next;
}
if (top == null)
@@ -539,7 +780,7 @@ public class WindowCache {
final Entry next;
/** The referenced object. */
- final Ref ref;
+ final PageRef<ByteWindow> ref;
/**
* Marked true when ref.get() returns null and the ref is dead.
@@ -550,34 +791,275 @@ public class WindowCache {
*/
volatile boolean dead;
- Entry(Entry n, Ref r) {
+ Entry(Entry n, PageRef<ByteWindow> r) {
next = n;
ref = r;
}
final void kill() {
dead = true;
- ref.enqueue();
+ ref.kill();
}
}
+ private static interface PageRef<T> {
+ /**
+ * Returns this reference object's referent. If this reference object
+ * has been cleared, either by the program or by the garbage collector,
+ * then this method returns <code>null</code>.
+ *
+ * @return The object to which this reference refers, or
+ * <code>null</code> if this reference object has been cleared
+ */
+ T get();
+
+ /**
+ * Kill this ref
+ *
+ * @return <code>true</code> if this reference object was successfully
+ * killed; <code>false</code> if it was already killed
+ */
+ boolean kill();
+
+ /**
+ * Get the packfile the referenced cache page is allocated for
+ *
+ * @return the packfile the referenced cache page is allocated for
+ */
+ PackFile getPack();
+
+ /**
+ * Get the position of the referenced cache page in the packfile
+ *
+ * @return the position of the referenced cache page in the packfile
+ */
+ long getPosition();
+
+ /**
+ * Get size of cache page
+ *
+ * @return size of cache page
+ */
+ int getSize();
+
+ /**
+ * Get pseudo time of last access to this cache page
+ *
+ * @return pseudo time of last access to this cache page
+ */
+ long getLastAccess();
+
+ /**
+ * Set pseudo time of last access to this cache page
+ *
+ * @param time
+ * pseudo time of last access to this cache page
+ */
+ void setLastAccess(long time);
+
+ /**
+ * Whether this is a strong reference.
+ * @return {@code true} if this is a strong reference
+ */
+ boolean isStrongRef();
+ }
+
/** A soft reference wrapped around a cached object. */
- private static class Ref extends SoftReference<ByteWindow> {
- final PackFile pack;
+ private static class SoftRef extends SoftReference<ByteWindow>
+ implements PageRef<ByteWindow> {
+ private final PackFile pack;
- final long position;
+ private final long position;
- final int size;
+ private final int size;
- long lastAccess;
+ private long lastAccess;
- protected Ref(final PackFile pack, final long position,
- final ByteWindow v, final ReferenceQueue<ByteWindow> queue) {
+ protected SoftRef(final PackFile pack, final long position,
+ final ByteWindow v, final SoftCleanupQueue queue) {
super(v, queue);
this.pack = pack;
this.position = position;
this.size = v.size();
}
+
+ @Override
+ public PackFile getPack() {
+ return pack;
+ }
+
+ @Override
+ public long getPosition() {
+ return position;
+ }
+
+ @Override
+ public int getSize() {
+ return size;
+ }
+
+ @Override
+ public long getLastAccess() {
+ return lastAccess;
+ }
+
+ @Override
+ public void setLastAccess(long time) {
+ this.lastAccess = time;
+ }
+
+ @Override
+ public boolean kill() {
+ return enqueue();
+ }
+
+ @Override
+ public boolean isStrongRef() {
+ return false;
+ }
+ }
+
+ /** A strong reference wrapped around a cached object. */
+ private static class StrongRef implements PageRef<ByteWindow> {
+ private ByteWindow referent;
+
+ private final PackFile pack;
+
+ private final long position;
+
+ private final int size;
+
+ private long lastAccess;
+
+ private CleanupQueue queue;
+
+ protected StrongRef(final PackFile pack, final long position,
+ final ByteWindow v, final CleanupQueue queue) {
+ this.pack = pack;
+ this.position = position;
+ this.referent = v;
+ this.size = v.size();
+ this.queue = queue;
+ }
+
+ @Override
+ public PackFile getPack() {
+ return pack;
+ }
+
+ @Override
+ public long getPosition() {
+ return position;
+ }
+
+ @Override
+ public int getSize() {
+ return size;
+ }
+
+ @Override
+ public long getLastAccess() {
+ return lastAccess;
+ }
+
+ @Override
+ public void setLastAccess(long time) {
+ this.lastAccess = time;
+ }
+
+ @Override
+ public ByteWindow get() {
+ return referent;
+ }
+
+ @Override
+ public boolean kill() {
+ if (referent == null) {
+ return false;
+ }
+ referent = null;
+ return queue.enqueue(this);
+ }
+
+ @Override
+ public boolean isStrongRef() {
+ return true;
+ }
+ }
+
+ private static interface CleanupQueue {
+ boolean enqueue(PageRef<ByteWindow> r);
+ void gc();
+ }
+
+ private static class SoftCleanupQueue extends ReferenceQueue<ByteWindow>
+ implements CleanupQueue {
+ private final WindowCache wc;
+
+ SoftCleanupQueue(WindowCache cache) {
+ this.wc = cache;
+ }
+
+ @Override
+ public boolean enqueue(PageRef<ByteWindow> r) {
+ // no need to explicitly add soft references which are enqueued by
+ // the JVM
+ return false;
+ }
+
+ @Override
+ public void gc() {
+ SoftRef r;
+ while ((r = (SoftRef) poll()) != null) {
+ wc.clear(r);
+
+ final int s = wc.slot(r.getPack(), r.getPosition());
+ final Entry e1 = wc.table.get(s);
+ for (Entry n = e1; n != null; n = n.next) {
+ if (n.ref == r) {
+ n.dead = true;
+ wc.table.compareAndSet(s, e1, clean(e1));
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ private static class StrongCleanupQueue implements CleanupQueue {
+ private final WindowCache wc;
+
+ private final ConcurrentLinkedQueue<PageRef<ByteWindow>> queue = new ConcurrentLinkedQueue<>();
+
+ StrongCleanupQueue(WindowCache wc) {
+ this.wc = wc;
+ }
+
+ @Override
+ public boolean enqueue(PageRef<ByteWindow> r) {
+ if (queue.contains(r)) {
+ return false;
+ }
+ return queue.add(r);
+ }
+
+ @Override
+ public void gc() {
+ PageRef<ByteWindow> r;
+ while ((r = queue.poll()) != null) {
+ wc.clear(r);
+
+ final int s = wc.slot(r.getPack(), r.getPosition());
+ final Entry e1 = wc.table.get(s);
+ for (Entry n = e1; n != null; n = n.next) {
+ if (n.ref == r) {
+ n.dead = true;
+ wc.table.compareAndSet(s, e1, clean(e1));
+ break;
+ }
+ }
+ }
+ }
}
private static final class Lock {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java
index 925b6beadb..46d2ab3397 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java
@@ -46,7 +46,6 @@ package org.eclipse.jgit.lib;
import static org.eclipse.jgit.transport.ReceiveCommand.Result.NOT_ATTEMPTED;
import static org.eclipse.jgit.transport.ReceiveCommand.Result.REJECTED_OTHER_REASON;
-import static java.util.stream.Collectors.toCollection;
import java.io.IOException;
import java.text.MessageFormat;
@@ -62,7 +61,6 @@ import java.util.concurrent.TimeoutException;
import org.eclipse.jgit.annotations.Nullable;
import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.internal.JGitText;
-import org.eclipse.jgit.lib.RefUpdate.Result;
import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.transport.PushCertificate;
import org.eclipse.jgit.transport.ReceiveCommand;
@@ -528,42 +526,24 @@ public class BatchRefUpdate {
}
}
if (!commands2.isEmpty()) {
- // What part of the name space is already taken
- Collection<String> takenNames = refdb.getRefs().stream()
- .map(Ref::getName)
- .collect(toCollection(HashSet::new));
- Collection<String> takenPrefixes = getTakenPrefixes(takenNames);
-
- // Now to the update that may require more room in the name space
+ // Perform updates that may require more room in the name space
for (ReceiveCommand cmd : commands2) {
try {
if (cmd.getResult() == NOT_ATTEMPTED) {
cmd.updateType(walk);
RefUpdate ru = newUpdate(cmd);
- SWITCH: switch (cmd.getType()) {
- case DELETE:
- // Performed in the first phase
- break;
- case UPDATE:
- case UPDATE_NONFASTFORWARD:
- RefUpdate ruu = newUpdate(cmd);
- cmd.setResult(ruu.update(walk));
- break;
- case CREATE:
- for (String prefix : getPrefixes(cmd.getRefName())) {
- if (takenNames.contains(prefix)) {
- cmd.setResult(Result.LOCK_FAILURE);
- break SWITCH;
- }
- }
- if (takenPrefixes.contains(cmd.getRefName())) {
- cmd.setResult(Result.LOCK_FAILURE);
- break SWITCH;
- }
- ru.setCheckConflicting(false);
- takenPrefixes.addAll(getPrefixes(cmd.getRefName()));
- takenNames.add(cmd.getRefName());
- cmd.setResult(ru.update(walk));
+ switch (cmd.getType()) {
+ case DELETE:
+ // Performed in the first phase
+ break;
+ case UPDATE:
+ case UPDATE_NONFASTFORWARD:
+ RefUpdate ruu = newUpdate(cmd);
+ cmd.setResult(ruu.update(walk));
+ break;
+ case CREATE:
+ cmd.setResult(ru.update(walk));
+ break;
}
}
} catch (IOException err) {
@@ -635,14 +615,6 @@ public class BatchRefUpdate {
execute(walk, monitor, null);
}
- private static Collection<String> getTakenPrefixes(Collection<String> names) {
- Collection<String> ref = new HashSet<>();
- for (String name : names) {
- addPrefixesTo(name, ref);
- }
- return ref;
- }
-
/**
* Get all path prefixes of a ref name.
*
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java
index 8f40db626a..078bf786f2 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java
@@ -230,6 +230,36 @@ public final class ConfigConstants {
/** The "streamFileThreshold" key */
public static final String CONFIG_KEY_STREAM_FILE_TRESHOLD = "streamFileThreshold";
+ /**
+ * The "packedGitMmap" key
+ * @since 5.1.13
+ */
+ public static final String CONFIG_KEY_PACKED_GIT_MMAP = "packedgitmmap";
+
+ /**
+ * The "packedGitWindowSize" key
+ * @since 5.1.13
+ */
+ public static final String CONFIG_KEY_PACKED_GIT_WINDOWSIZE = "packedgitwindowsize";
+
+ /**
+ * The "packedGitLimit" key
+ * @since 5.1.13
+ */
+ public static final String CONFIG_KEY_PACKED_GIT_LIMIT = "packedgitlimit";
+
+ /**
+ * The "packedGitOpenFiles" key
+ * @since 5.1.13
+ */
+ public static final String CONFIG_KEY_PACKED_GIT_OPENFILES = "packedgitopenfiles";
+
+ /**
+ * The "packedGitUseStrongRefs" key
+ * @since 5.1.13
+ */
+ public static final String CONFIG_KEY_PACKED_GIT_USE_STRONGREFS = "packedgitusestrongrefs";
+
/** The "remote" key */
public static final String CONFIG_KEY_REMOTE = "remote";
@@ -495,4 +525,10 @@ public final class ConfigConstants {
* @since 5.1.9
*/
public static final String CONFIG_KEY_MIN_RACY_THRESHOLD = "minRacyThreshold";
+
+ /**
+ * The "jmx" section
+ * @since 5.1.13
+ */
+ public static final String CONFIG_JMX_SECTION = "jmx";
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/GitmoduleEntry.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/GitmoduleEntry.java
index bded527519..4f2e558b26 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/GitmoduleEntry.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/GitmoduleEntry.java
@@ -42,8 +42,6 @@
*/
package org.eclipse.jgit.lib;
-import org.eclipse.jgit.lib.AnyObjectId;
-
/**
* A .gitmodules file found in the pack. Store the blob of the file itself (e.g.
* to access its contents) and the tree where it was found (e.g. to check if it
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java
index 5bb8153a58..9bec2e177d 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java
@@ -252,7 +252,7 @@ public class FileBasedConfig extends StoredConfig {
if (!lf.lock())
throw new LockFailedException(getFile());
try {
- lf.setNeedSnapshot(true);
+ lf.setNeedSnapshotNoConfig(true);
lf.write(out);
if (!lf.commit())
throw new IOException(MessageFormat.format(JGitText.get().cannotCommitWriteTo, getFile()));
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheConfig.java
index ff499764c9..be19df82b2 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheConfig.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheConfig.java
@@ -43,6 +43,15 @@
package org.eclipse.jgit.storage.file;
+import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_CORE_SECTION;
+import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_DELTA_BASE_CACHE_LIMIT;
+import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_PACKED_GIT_LIMIT;
+import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_PACKED_GIT_MMAP;
+import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_PACKED_GIT_OPENFILES;
+import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_PACKED_GIT_WINDOWSIZE;
+import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_STREAM_FILE_TRESHOLD;
+import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_PACKED_GIT_USE_STRONGREFS;
+
import org.eclipse.jgit.internal.storage.file.WindowCache;
import org.eclipse.jgit.lib.Config;
import org.eclipse.jgit.storage.pack.PackConfig;
@@ -61,6 +70,8 @@ public class WindowCacheConfig {
private long packedGitLimit;
+ private boolean useStrongRefs;
+
private int packedGitWindowSize;
private boolean packedGitMMAP;
@@ -75,6 +86,7 @@ public class WindowCacheConfig {
public WindowCacheConfig() {
packedGitOpenFiles = 128;
packedGitLimit = 10 * MB;
+ useStrongRefs = false;
packedGitWindowSize = 8 * KB;
packedGitMMAP = false;
deltaBaseCacheLimit = 10 * MB;
@@ -126,6 +138,31 @@ public class WindowCacheConfig {
}
/**
+ * Get whether the window cache should use strong references or
+ * SoftReferences
+ *
+ * @return {@code true} if the window cache should use strong references,
+ * otherwise it will use {@link java.lang.ref.SoftReference}s
+ * @since 5.1.13
+ */
+ public boolean isPackedGitUseStrongRefs() {
+ return useStrongRefs;
+ }
+
+ /**
+ * Set if the cache should use strong refs or soft refs
+ *
+ * @param useStrongRefs
+ * if @{code true} the cache strongly references cache pages
+ * otherwise it uses {@link java.lang.ref.SoftReference}s which
+ * can be evicted by the Java gc if heap is almost full
+ * @since 5.1.13
+ */
+ public void setPackedGitUseStrongRefs(boolean useStrongRefs) {
+ this.useStrongRefs = useStrongRefs;
+ }
+
+ /**
* Get size in bytes of a single window mapped or read in from the pack
* file.
*
@@ -227,20 +264,23 @@ public class WindowCacheConfig {
* @since 3.0
*/
public WindowCacheConfig fromConfig(Config rc) {
- setPackedGitOpenFiles(rc.getInt(
- "core", null, "packedgitopenfiles", getPackedGitOpenFiles())); //$NON-NLS-1$ //$NON-NLS-2$
- setPackedGitLimit(rc.getLong(
- "core", null, "packedgitlimit", getPackedGitLimit())); //$NON-NLS-1$ //$NON-NLS-2$
- setPackedGitWindowSize(rc.getInt(
- "core", null, "packedgitwindowsize", getPackedGitWindowSize())); //$NON-NLS-1$ //$NON-NLS-2$
- setPackedGitMMAP(rc.getBoolean(
- "core", null, "packedgitmmap", isPackedGitMMAP())); //$NON-NLS-1$ //$NON-NLS-2$
- setDeltaBaseCacheLimit(rc.getInt(
- "core", null, "deltabasecachelimit", getDeltaBaseCacheLimit())); //$NON-NLS-1$ //$NON-NLS-2$
+ setPackedGitUseStrongRefs(rc.getBoolean(CONFIG_CORE_SECTION,
+ CONFIG_KEY_PACKED_GIT_USE_STRONGREFS,
+ isPackedGitUseStrongRefs()));
+ setPackedGitOpenFiles(rc.getInt(CONFIG_CORE_SECTION, null,
+ CONFIG_KEY_PACKED_GIT_OPENFILES, getPackedGitOpenFiles()));
+ setPackedGitLimit(rc.getLong(CONFIG_CORE_SECTION, null,
+ CONFIG_KEY_PACKED_GIT_LIMIT, getPackedGitLimit()));
+ setPackedGitWindowSize(rc.getInt(CONFIG_CORE_SECTION, null,
+ CONFIG_KEY_PACKED_GIT_WINDOWSIZE, getPackedGitWindowSize()));
+ setPackedGitMMAP(rc.getBoolean(CONFIG_CORE_SECTION, null,
+ CONFIG_KEY_PACKED_GIT_MMAP, isPackedGitMMAP()));
+ setDeltaBaseCacheLimit(rc.getInt(CONFIG_CORE_SECTION, null,
+ CONFIG_KEY_DELTA_BASE_CACHE_LIMIT, getDeltaBaseCacheLimit()));
long maxMem = Runtime.getRuntime().maxMemory();
- long sft = rc.getLong(
- "core", null, "streamfilethreshold", getStreamFileThreshold()); //$NON-NLS-1$ //$NON-NLS-2$
+ long sft = rc.getLong(CONFIG_CORE_SECTION, null,
+ CONFIG_KEY_STREAM_FILE_TRESHOLD, getStreamFileThreshold());
sft = Math.min(sft, maxMem / 4); // don't use more than 1/4 of the heap
sft = Math.min(sft, Integer.MAX_VALUE); // cannot exceed array length
setStreamFileThreshold((int) sft);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheStats.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheStats.java
index 3570733e41..65f8dae342 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheStats.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheStats.java
@@ -40,29 +40,202 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
package org.eclipse.jgit.storage.file;
+import java.util.Map;
+
+import javax.management.MXBean;
+
import org.eclipse.jgit.internal.storage.file.WindowCache;
/**
- * Accessor for stats about {@link WindowCache}.
+ * Cache statistics for {@link WindowCache}.
*
* @since 4.11
- *
*/
-public class WindowCacheStats {
+@MXBean
+public interface WindowCacheStats {
/**
* @return the number of open files.
+ * @deprecated use {@link #getOpenFileCount()} instead
*/
+ @Deprecated
public static int getOpenFiles() {
- return WindowCache.getInstance().getOpenFiles();
+ return (int) WindowCache.getInstance().getStats().getOpenFileCount();
}
/**
* @return the number of open bytes.
+ * @deprecated use {@link #getOpenByteCount()} instead
*/
+ @Deprecated
public static long getOpenBytes() {
- return WindowCache.getInstance().getOpenBytes();
+ return WindowCache.getInstance().getStats().getOpenByteCount();
+ }
+
+ /**
+ * @return cache statistics for the WindowCache
+ * @since 5.1.13
+ */
+ public static WindowCacheStats getStats() {
+ return WindowCache.getInstance().getStats();
+ }
+
+ /**
+ * Number of cache hits
+ *
+ * @return number of cache hits
+ */
+ long getHitCount();
+
+ /**
+ * Ratio of cache requests which were hits defined as
+ * {@code hitCount / requestCount}, or {@code 1.0} when
+ * {@code requestCount == 0}. Note that {@code hitRate + missRate =~ 1.0}.
+ *
+ * @return the ratio of cache requests which were hits
+ */
+ default double getHitRatio() {
+ long requestCount = getRequestCount();
+ return (requestCount == 0) ? 1.0
+ : (double) getHitCount() / requestCount;
+ }
+
+ /**
+ * Number of cache misses.
+ *
+ * @return number of cash misses
+ */
+ long getMissCount();
+
+ /**
+ * Ratio of cache requests which were misses defined as
+ * {@code missCount / requestCount}, or {@code 0.0} when
+ * {@code requestCount == 0}. Note that {@code hitRate + missRate =~ 1.0}.
+ * Cache misses include all requests which weren't cache hits, including
+ * requests which resulted in either successful or failed loading attempts.
+ *
+ * @return the ratio of cache requests which were misses
+ */
+ default double getMissRatio() {
+ long requestCount = getRequestCount();
+ return (requestCount == 0) ? 0.0
+ : (double) getMissCount() / requestCount;
+ }
+
+ /**
+ * Number of successful loads
+ *
+ * @return number of successful loads
+ */
+ long getLoadSuccessCount();
+
+ /**
+ * Number of failed loads
+ *
+ * @return number of failed loads
+ */
+ long getLoadFailureCount();
+
+ /**
+ * Ratio of cache load attempts which threw exceptions. This is defined as
+ * {@code loadFailureCount / (loadSuccessCount + loadFailureCount)}, or
+ * {@code 0.0} when {@code loadSuccessCount + loadFailureCount == 0}.
+ *
+ * @return the ratio of cache loading attempts which threw exceptions
+ */
+ default double getLoadFailureRatio() {
+ long loadFailureCount = getLoadFailureCount();
+ long totalLoadCount = getLoadSuccessCount() + loadFailureCount;
+ return (totalLoadCount == 0) ? 0.0
+ : (double) loadFailureCount / totalLoadCount;
+ }
+
+ /**
+ * Total number of times that the cache attempted to load new values. This
+ * includes both successful load operations, as well as failed loads. This
+ * is defined as {@code loadSuccessCount + loadFailureCount}.
+ *
+ * @return the {@code loadSuccessCount + loadFailureCount}
+ */
+ default long getLoadCount() {
+ return getLoadSuccessCount() + getLoadFailureCount();
}
+
+ /**
+ * Number of cache evictions
+ *
+ * @return number of evictions
+ */
+ long getEvictionCount();
+
+ /**
+ * Ratio of cache evictions. This is defined as
+ * {@code evictionCount / requestCount}, or {@code 0.0} when
+ * {@code requestCount == 0}.
+ *
+ * @return the ratio of cache loading attempts which threw exceptions
+ */
+ default double getEvictionRatio() {
+ long evictionCount = getEvictionCount();
+ long requestCount = getRequestCount();
+ return (requestCount == 0) ? 0.0
+ : (double) evictionCount / requestCount;
+ }
+
+ /**
+ * Number of times the cache returned either a cached or uncached value.
+ * This is defined as {@code hitCount + missCount}.
+ *
+ * @return the {@code hitCount + missCount}
+ */
+ default long getRequestCount() {
+ return getHitCount() + getMissCount();
+ }
+
+ /**
+ * Average time in nanoseconds for loading new values. This is
+ * {@code totalLoadTime / (loadSuccessCount + loadFailureCount)}.
+ *
+ * @return the average time spent loading new values
+ */
+ default double getAverageLoadTime() {
+ long totalLoadCount = getLoadSuccessCount() + getLoadFailureCount();
+ return (totalLoadCount == 0) ? 0.0
+ : (double) getTotalLoadTime() / totalLoadCount;
+ }
+
+ /**
+ * Total time in nanoseconds the cache spent loading new values.
+ *
+ * @return the total number of nanoseconds the cache has spent loading new
+ * values
+ */
+ long getTotalLoadTime();
+
+ /**
+ * Number of pack files kept open by the cache
+ *
+ * @return number of files kept open by cache
+ */
+ long getOpenFileCount();
+
+ /**
+ * Number of bytes cached
+ *
+ * @return number of bytes cached
+ */
+ long getOpenByteCount();
+
+ /**
+ * Number of bytes cached per repository
+ *
+ * @return number of bytes cached per repository
+ */
+ Map<String, Long> getOpenByteCountPerRepository();
+
+ /**
+ * Reset counters. Does not reset open bytes and open files counters.
+ */
+ void resetCounters();
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/AbstractTreeIterator.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/AbstractTreeIterator.java
index 335abe1b5b..a3c93cf87a 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/AbstractTreeIterator.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/AbstractTreeIterator.java
@@ -239,12 +239,10 @@ public abstract class AbstractTreeIterator {
path = p.path;
pathOffset = p.pathLen + 1;
- try {
- path[pathOffset - 1] = '/';
- } catch (ArrayIndexOutOfBoundsException e) {
+ if (pathOffset > path.length) {
growPath(p.pathLen);
- path[pathOffset - 1] = '/';
}
+ path[pathOffset - 1] = '/';
}
/**
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/CanonicalTreeParser.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/CanonicalTreeParser.java
index 019968875d..b2d8fc3aa8 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/CanonicalTreeParser.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/CanonicalTreeParser.java
@@ -387,14 +387,13 @@ public class CanonicalTreeParser extends AbstractTreeIterator {
tmp = pathOffset;
for (;; tmp++) {
c = raw[ptr++];
- if (c == 0)
+ if (c == 0) {
break;
- try {
- path[tmp] = c;
- } catch (ArrayIndexOutOfBoundsException e) {
+ }
+ if (tmp >= path.length) {
growPath(tmp);
- path[tmp] = c;
}
+ path[tmp] = c;
}
pathLen = tmp;
nextPtr = ptr + OBJECT_ID_LENGTH;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/Monitoring.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/Monitoring.java
new file mode 100644
index 0000000000..83bf695f70
--- /dev/null
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/Monitoring.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2019 Matthias Sohn <matthias.sohn@sap.com>
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0 which is available at
+ * https://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+package org.eclipse.jgit.util;
+
+import java.io.IOException;
+import java.lang.management.ManagementFactory;
+
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanRegistrationException;
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+import javax.management.NotCompliantMBeanException;
+import javax.management.ObjectInstance;
+import javax.management.ObjectName;
+
+import org.eclipse.jgit.annotations.Nullable;
+import org.eclipse.jgit.errors.ConfigInvalidException;
+import org.eclipse.jgit.lib.ConfigConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Enables monitoring JGit via JMX
+ *
+ * @since 5.1.13
+ */
+public class Monitoring {
+ private final static Logger LOG = LoggerFactory.getLogger(Monitoring.class);
+
+ /**
+ * Register a MBean with the platform MBean server
+ *
+ * @param mbean
+ * the mbean object to register
+ * @param metricName
+ * name of the JGit metric, will be prefixed with
+ * "org.eclipse.jgit/"
+ * @return the registered mbean's object instance
+ */
+ public static @Nullable ObjectInstance registerMBean(Object mbean,
+ String metricName) {
+ boolean register = false;
+ try {
+ Class<?> interfaces[] = mbean.getClass().getInterfaces();
+ for (Class<?> i : interfaces) {
+ register = SystemReader.getInstance().getUserConfig()
+ .getBoolean(
+ ConfigConstants.CONFIG_JMX_SECTION,
+ i.getSimpleName(), false);
+ if (register) {
+ break;
+ }
+ }
+ } catch (IOException | ConfigInvalidException e) {
+ LOG.error(e.getMessage(), e);
+ return null;
+ }
+ if (!register) {
+ return null;
+ }
+ MBeanServer server = ManagementFactory.getPlatformMBeanServer();
+ try {
+ ObjectName mbeanName = objectName(mbean.getClass(), metricName);
+ if (server.isRegistered(mbeanName)) {
+ server.unregisterMBean(mbeanName);
+ }
+ return server.registerMBean(mbean, mbeanName);
+ } catch (MalformedObjectNameException | InstanceAlreadyExistsException
+ | MBeanRegistrationException | NotCompliantMBeanException
+ | InstanceNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ return null;
+ }
+ }
+
+ private static ObjectName objectName(Class mbean, String metricName)
+ throws MalformedObjectNameException {
+ return new ObjectName(String.format("org.eclipse.jgit/%s:type=%s", //$NON-NLS-1$
+ metricName, mbean.getSimpleName()));
+ }
+}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/SshSupport.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/SshSupport.java
index 913aa72867..ac5be1bf20 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/SshSupport.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/SshSupport.java
@@ -94,6 +94,7 @@ public class SshSupport {
CommandFailedException failure = null;
@SuppressWarnings("resource")
MessageWriter stderr = new MessageWriter();
+ String out;
try (MessageWriter stdout = new MessageWriter()) {
session = SshSessionFactory.getInstance().getSession(sshUri,
provider, fs, 1000 * timeout);
@@ -108,12 +109,12 @@ public class SshSupport {
// waitFor with timeout has a bug - JSch' exitValue() throws the
// wrong exception type :(
if (process.waitFor() == 0) {
- return stdout.toString();
+ out = stdout.toString();
} else {
- return null; // still running after timeout
+ out = null; // still running after timeout
}
} catch (InterruptedException e) {
- return null; // error
+ out = null; // error
}
} finally {
if (errorThread != null) {
@@ -147,10 +148,11 @@ public class SshSupport {
if (session != null) {
SshSessionFactory.getInstance().releaseSession(session);
}
- if (failure != null) {
- throw failure;
- }
}
+ if (failure != null) {
+ throw failure;
+ }
+ return out;
}
}
diff --git a/pom.xml b/pom.xml
index 275e67f770..26b1c1ae8a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -199,15 +199,14 @@
<httpcore-version>4.4.10</httpcore-version>
<slf4j-version>1.7.2</slf4j-version>
<log4j-version>1.2.15</log4j-version>
- <maven-javadoc-plugin-version>3.1.0</maven-javadoc-plugin-version>
- <tycho-extras-version>1.4.0</tycho-extras-version>
+ <maven-javadoc-plugin-version>3.3.1</maven-javadoc-plugin-version>
+ <tycho-extras-version>1.7.0</tycho-extras-version>
<gson-version>2.8.2</gson-version>
<bouncycastle-version>1.61</bouncycastle-version>
- <spotbugs-maven-plugin-version>3.1.12</spotbugs-maven-plugin-version>
- <maven-project-info-reports-plugin-version>3.0.0</maven-project-info-reports-plugin-version>
- <maven-jxr-plugin-version>3.0.0</maven-jxr-plugin-version>
- <spotbugs-maven-plugin-version>3.1.12</spotbugs-maven-plugin-version>
- <maven-surefire-plugin-version>3.0.0-M3</maven-surefire-plugin-version>
+ <maven-project-info-reports-plugin-version>3.1.2</maven-project-info-reports-plugin-version>
+ <maven-surefire-plugin-version>3.0.0-M5</maven-surefire-plugin-version>
+ <spotbugs-maven-plugin-version>4.3.0</spotbugs-maven-plugin-version>
+ <maven-surefire-plugin-version>3.0.0-M5</maven-surefire-plugin-version>
<maven-surefire-report-plugin-version>${maven-surefire-plugin-version}</maven-surefire-report-plugin-version>
<maven-compiler-plugin-version>3.8.1</maven-compiler-plugin-version>
@@ -241,7 +240,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
- <version>3.1.2</version>
+ <version>3.2.0</version>
<configuration>
<archive>
<manifestEntries>
@@ -266,25 +265,25 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
- <version>3.2.1</version>
+ <version>3.2.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
- <version>1.8</version>
+ <version>3.0.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
- <version>3.1.1</version>
+ <version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
- <version>3.1.0</version>
+ <version>3.2.1</version>
</plugin>
<plugin>
@@ -307,7 +306,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
- <version>3.0.0</version>
+ <version>3.2.0</version>
</plugin>
<plugin>
@@ -330,7 +329,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
- <version>3.12.0</version>
+ <version>3.15.0</version>
<configuration>
<sourceEncoding>utf-8</sourceEncoding>
<minimumTokens>100</minimumTokens>
@@ -353,7 +352,7 @@
<plugin>
<groupId>org.eclipse.cbi.maven.plugins</groupId>
<artifactId>eclipse-jarsigner-plugin</artifactId>
- <version>1.1.5</version>
+ <version>1.3.2</version>
</plugin>
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
@@ -368,12 +367,12 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
- <version>0.8.4</version>
+ <version>0.8.7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
- <version>3.7.1</version>
+ <version>3.9.1</version>
<dependencies>
<dependency><!-- add support for ssh/scp -->
<groupId>org.apache.maven.wagon</groupId>
@@ -415,7 +414,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
- <version>3.1.0</version>
+ <version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
@@ -429,7 +428,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
- <version>3.0.0-M2</version>
+ <version>3.0.0</version>
<executions>
<execution>
<id>enforce-maven</id>
@@ -836,7 +835,6 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
- <version>${maven-compiler-plugin-version}</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.8</source>
@@ -905,7 +903,6 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
- <version>${maven-compiler-plugin-version}</version>
<configuration>
<compilerId>eclipse</compilerId>
<encoding>UTF-8</encoding>
diff --git a/tools/bzl/jmh.bzl b/tools/bzl/jmh.bzl
index eee9ed02c6..a51a42cf33 100644
--- a/tools/bzl/jmh.bzl
+++ b/tools/bzl/jmh.bzl
@@ -41,6 +41,8 @@
# Definitions to run jmh microbenchmarks
+load("@rules_java//java:defs.bzl", "java_binary", "java_plugin")
+
def jmh_java_benchmarks(name, srcs, deps = [], tags = [], plugins = [], **kwargs):
"""Builds runnable JMH benchmarks.
This rule builds a runnable target for one or more JMH benchmarks
@@ -48,14 +50,14 @@ def jmh_java_benchmarks(name, srcs, deps = [], tags = [], plugins = [], **kwargs
except for main_class.
"""
plugin_name = "_{}_jmh_annotation_processor".format(name)
- native.java_plugin(
+ java_plugin(
name = plugin_name,
deps = ["//lib/jmh:jmh"],
processor_class = "org.openjdk.jmh.generators.BenchmarkProcessor",
visibility = ["//visibility:private"],
tags = tags,
)
- native.java_binary(
+ java_binary(
name = name,
srcs = srcs,
main_class = "org.openjdk.jmh.Main",
@@ -63,4 +65,4 @@ def jmh_java_benchmarks(name, srcs, deps = [], tags = [], plugins = [], **kwargs
plugins = plugins + [plugin_name],
tags = tags,
**kwargs
- ) \ No newline at end of file
+ )

Back to the top