Merge branch 'stable-6.9' into stable-6.10 * stable-6.9: MergeToolTest: update expected error from the tool Add dash license check for 3rd party dependencies Prepare 5.13.5-SNAPSHOT builds JGit v5.13.4.202507202350-r AmazonS3: Do not accept DOCTYPE and entities ManifestParser: Do not accept DOCTYPE and entities AdvertisedRequestValidator: fix WantNotValidException caused by race Prepare 5.13.4-SNAPSHOT builds Fix packaging build Change-Id: Id42981e23f88ffcfb565a9d3418e6a8899bad0bc
diff --git a/.bazelrc b/.bazelrc index 5e1df62..7c71c4a 100644 --- a/.bazelrc +++ b/.bazelrc
@@ -1,6 +1,10 @@ +# TODO(davido): Migrate all dependencies from WORKSPACE to MODULE.bazel +# https://issues.gerritcodereview.com/issues/303819949 +common --noenable_bzlmod + build --workspace_status_command="python ./tools/workspace_status.py" build --repository_cache=~/.gerritcodereview/bazel-cache/repository -build --experimental_strict_action_env +build --incompatible_strict_action_env build --action_env=PATH build --disk_cache=~/.gerritcodereview/bazel-cache/cas @@ -17,7 +21,7 @@ build:remote11 --tool_java_runtime_version=remotejdk_11 build:remote11 --config=remote -# Builds using remote_jdk17, executes using remote_jdk11 or local_jdk +# Builds using remote_jdk17, executes using remote_jdk17 or local_jdk build:java17 --java_language_version=17 build:java17 --java_runtime_version=remotejdk_17 build:java17 --tool_java_language_version=17 @@ -30,6 +34,19 @@ build:remote17 --tool_java_runtime_version=remotejdk_17 build:remote17 --config=remote +# Builds using remote_jdk21, executes using remote_jdk21 or local_jdk +build:java21 --java_language_version=21 +build:java21 --java_runtime_version=remotejdk_21 +build:java21 --tool_java_language_version=21 +build:java21 --tool_java_runtime_version=remotejdk_21 + +# Builds and executes on RBE using remotejdk_21 +build:remote21 --java_language_version=21 +build:remote21 --java_runtime_version=remotejdk_21 +build:remote21 --tool_java_language_version=21 +build:remote21 --tool_java_runtime_version=remotejdk_21 +build:remote21 --config=remote + test --build_tests_only test --test_output=errors test --flaky_test_attempts=3
diff --git a/.bazelversion b/.bazelversion index 91e4a9f..21c8c7b 100644 --- a/.bazelversion +++ b/.bazelversion
@@ -1 +1 @@ -6.3.2 +7.1.1
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..19909ac --- /dev/null +++ b/.github/pull_request_template.md
@@ -0,0 +1,5 @@ +Thank you for contributing to JGit! + +JGit uses [GerritHub](https://eclipse.gerrithub.io) for code changes and review, therefore **pull requests in this repository cannot be merged**. + +Please make sure you have read the section on [contributing patches](https://github.com/eclipse-egit/egit/wiki/Contributor-Guide#contributing-patches) of the [Contributor Guide](https://github.com/eclipse-egit/egit/wiki/Contributor-Guide). \ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bb9df9f..7496cf9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md
@@ -8,7 +8,9 @@ For anything other than small changes, it's a good idea to open a bug report for it (in case one doesn't already exist). This gives others the chance to give input and is useful for tracking. -[Create JGit bugs here](https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JGit). +[Open JGit issues on GitHub](https://github.com/eclipse-jgit/jgit/issues). + +Older bugs can be found [in Bugzilla](https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=__open__&component=JGit&list_id=21379030&product=JGit). ## Submitting changes
diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 0000000..0b932b8 --- /dev/null +++ b/MODULE.bazel
@@ -0,0 +1,2 @@ +# TODO(davido): Migrate all dependencies from WORKSPACE to MODULE.bazel +# https://issues.gerritcodereview.com/issues/303819949
diff --git a/WORKSPACE b/WORKSPACE index 21ebc72..ecaa82a 100644 --- a/WORKSPACE +++ b/WORKSPACE
@@ -11,12 +11,24 @@ ) http_archive( - name = "rbe_jdk11", - sha256 = "dbcfd6f26589ef506b91fe03a12dc559ca9c84699e4cf6381150522287f0e6f6", - strip_prefix = "rbe_autoconfig-3.1.0", + name = "rules_java", + sha256 = "4da3761f6855ad916568e2bfe86213ba6d2637f56b8360538a7fb6125abf6518", urls = [ - "https://gerrit-bazel.storage.googleapis.com/rbe_autoconfig/v3.1.0.tar.gz", - "https://github.com/davido/rbe_autoconfig/archive/v3.1.0.tar.gz", + "https://github.com/bazelbuild/rules_java/releases/download/7.5.0/rules_java-7.5.0.tar.gz", + ], +) + +load("@rules_java//java:repositories.bzl", "rules_java_dependencies", "rules_java_toolchains") + +rules_java_dependencies() + +http_archive( + name = "ubuntu2204_jdk17", + sha256 = "8ea82b81c9707e535ff93ef5349d11e55b2a23c62bcc3b0faaec052144aed87d", + strip_prefix = "rbe_autoconfig-5.1.0", + urls = [ + "https://gerrit-bazel.storage.googleapis.com/rbe_autoconfig/v5.1.0.tar.gz", + "https://github.com/davido/rbe_autoconfig/releases/download/v5.1.0/v5.1.0.tar.gz", ], ) @@ -24,6 +36,14 @@ register_toolchains("//tools:error_prone_warnings_toolchain_java17_definition") +register_toolchains("//tools:error_prone_warnings_toolchain_java21_definition") + +# Order of registering toolchains matters. rules_java toolchains take precedence +# over the custom toolchains, so the default jdk21 toolchain gets picked +# (one without custom package_config). That's why the `rules_java_toolchains()` +# must be called after the `register_toolchain()` invocation. +rules_java_toolchains() + JMH_VERS = "1.37" maven_jar( @@ -90,18 +110,18 @@ sha1 = "51cf043c87253c9f58b539c9f7e44c8894223850", ) -SSHD_VERS = "2.12.0" +SSHD_VERS = "2.14.0" maven_jar( name = "sshd-osgi", artifact = "org.apache.sshd:sshd-osgi:" + SSHD_VERS, - sha1 = "32b8de1cbb722ba75bdf9898e0c41d42af00ce57", + sha1 = "6ef66228a088f8ac1383b2ff28f3102f80ebc01a", ) maven_jar( name = "sshd-sftp", artifact = "org.apache.sshd:sshd-sftp:" + SSHD_VERS, - sha1 = "0f96f00a07b186ea62838a6a4122e8f4cad44df6", + sha1 = "c070ac920e72023ae9ab0a3f3a866bece284b470", ) JNA_VERS = "5.14.0" @@ -120,14 +140,14 @@ maven_jar( name = "commons-codec", - artifact = "commons-codec:commons-codec:1.16.0", - sha1 = "4e3eb3d79888d76b54e28b350915b5dc3919c9de", + artifact = "commons-codec:commons-codec:1.17.0", + sha1 = "0dbe8eef6e14460e73da07f7b11bf994d6626355", ) maven_jar( name = "commons-logging", - artifact = "commons-logging:commons-logging:1.2", - sha1 = "4bfc12adfe4842bf07b657f0369c4cb522955686", + artifact = "commons-logging:commons-logging:1.3.2", + sha1 = "3dc966156ef19d23c839715165435e582fafa753", ) maven_jar( @@ -150,14 +170,20 @@ maven_jar( name = "commons-compress", - artifact = "org.apache.commons:commons-compress:1.26.0", - sha1 = "659feffdd12280201c8aacb8f7be94f9a883c824", + artifact = "org.apache.commons:commons-compress:1.26.2", + sha1 = "eb1f823447af685208e684fce84783b43517960c", +) + +maven_jar( + name = "commons-lang3", + artifact = "org.apache.commons:commons-lang3:3.14.0", + sha1 = "1ed471194b02f2c6cb734a0cd6f6f107c673afae", ) maven_jar( name = "commons-io", - artifact = "commons-io:commons-io:2.15.1", - sha1 = "f11560da189ab563a5c8e351941415430e9304ea", + artifact = "commons-io:commons-io:2.16.1", + sha1 = "377d592e740dc77124e0901291dbfaa6810a200e", ) maven_jar( @@ -168,8 +194,8 @@ maven_jar( name = "args4j", - artifact = "args4j:args4j:2.33", - sha1 = "bd87a75374a6d6523de82fef51fc3cfe9baf9fc9", + artifact = "args4j:args4j:2.37", + sha1 = "244f60c057d72a785227c0562d3560f42a7ea54b", ) maven_jar( @@ -186,119 +212,119 @@ maven_jar( name = "mockito", - artifact = "org.mockito:mockito-core:5.10.0", - sha1 = "b3812fa2ee069f1d0b41c1c0155da79d0e1dcde0", + artifact = "org.mockito:mockito-core:5.12.0", + sha1 = "22f8bbaf478e6789164787fa411a3b5ed986e110", ) maven_jar( name = "assertj-core", - artifact = "org.assertj:assertj-core:3.25.3", - sha1 = "792b270e73aa1cfc28fa135be0b95e69ea451432", + artifact = "org.assertj:assertj-core:3.26.0", + sha1 = "fc4a3d051da838946f9dffe725efbd06cd7d1eec", ) -BYTE_BUDDY_VERSION = "1.14.12" +BYTE_BUDDY_VERSION = "1.14.16" maven_jar( name = "bytebuddy", artifact = "net.bytebuddy:byte-buddy:" + BYTE_BUDDY_VERSION, - sha1 = "6e37f743dc15a8d7a4feb3eb0025cbc612d5b9e1", + sha1 = "e1b9a06e131b7d5b183c8ccc7c29b9e5a8dba077", ) maven_jar( name = "bytebuddy-agent", artifact = "net.bytebuddy:byte-buddy-agent:" + BYTE_BUDDY_VERSION, - sha1 = "be4984cb6fd1ef1d11f218a648889dfda44b8a15", + sha1 = "4a451ee6484abac3a498df0f3b33ed00a6fced4d", ) maven_jar( name = "objenesis", - artifact = "org.objenesis:objenesis:3.3", - sha1 = "1049c09f1de4331e8193e579448d0916d75b7631", + artifact = "org.objenesis:objenesis:3.4", + sha1 = "675cbe121a68019235d27f6c34b4f0ac30e07418", ) maven_jar( name = "gson", - artifact = "com.google.code.gson:gson:2.10.1", - sha1 = "b3add478d4382b78ea20b1671390a858002feb6c", + artifact = "com.google.code.gson:gson:2.11.0", + sha1 = "527175ca6d81050b53bdd4c457a6d6e017626b0e", ) -JETTY_VER = "10.0.20" +JETTY_VER = "10.0.21" maven_jar( name = "jetty-servlet", artifact = "org.eclipse.jetty:jetty-servlet:" + JETTY_VER, - sha1 = "e3661d28d5f2e2185fb085ce5560b2969e8f7c1e", - src_sha1 = "23b97219833769e3e69a071abab3811f49077e2e", + sha1 = "6de2f73e1edbd368b14c485597d555d1190e6221", + src_sha1 = "6a82804a625a730a13dfcb9fbd3c9d09016bae92", ) maven_jar( name = "jetty-security", artifact = "org.eclipse.jetty:jetty-security:" + JETTY_VER, - sha1 = "f082f9198038e4781ff4cdf4d32db9f90fa8f38a", - src_sha1 = "a1acb8cb40bd495ba67562cb342f371425dba47b", + sha1 = "fec31c853de43a15a5a75f2e1492e930366d4595", + src_sha1 = "ef7660113cae5cfbf4fb24c6c8d832a74d4fd800", ) maven_jar( name = "jetty-server", artifact = "org.eclipse.jetty:jetty-server:" + JETTY_VER, - sha1 = "66deea078236e21ae9dd7443716b7642766526aa", - src_sha1 = "e2ddea07b6c85dbc7cf078e408f68d69e504b33c", + sha1 = "1e49b8b6d0ce2f8e484e4eec3d8b0a55c4cc599c", + src_sha1 = "a6b18935ddbe227a717bea6343603a8cf2629e0c", ) maven_jar( name = "jetty-http", artifact = "org.eclipse.jetty:jetty-http:" + JETTY_VER, - sha1 = "d76bf933db81e9f530f1e59f1858bceddb7c4a43", - src_sha1 = "5fd939e4e5000ac76eb686e68e978747802c8a5f", + sha1 = "26c21d1d16f2929c8f58f177a246687444217cbe", + src_sha1 = "fa315f1a44b11759c14373c5bafe4014c837d3a6", ) maven_jar( name = "jetty-io", artifact = "org.eclipse.jetty:jetty-io:" + JETTY_VER, - sha1 = "269cea7949f739e41707f3d574782c9f227fe188", - src_sha1 = "1d30687503a0256da23706e1ebf597658d8c0011", + sha1 = "21bb67ceae5fa145ee86ce88a5609c908b880bf8", + src_sha1 = "44afc9e83169cc40b6b13ab49789693da1298860", ) maven_jar( name = "jetty-util", artifact = "org.eclipse.jetty:jetty-util:" + JETTY_VER, - sha1 = "c628108266e75f17dffee34191b74a696fe21746", - src_sha1 = "63c17b20a8ca5c3bc1740bd807ad446f842749b4", + sha1 = "141f604e6ae732bf2c5e7488ddf82697eb7d8b86", + src_sha1 = "91da8bf1f086a98dbb11c8ef63f79dd9f0f66c33", ) maven_jar( name = "jetty-util-ajax", artifact = "org.eclipse.jetty:jetty-util-ajax:" + JETTY_VER, - sha1 = "049dcc0ad4190786e17389b257195fe936ed3d27", - src_sha1 = "b012c053d25d902cc64a5c4432a8eedab3241d94", + sha1 = "8bc368c8619dee1e30de0ca57189569ba17bd86e", + src_sha1 = "17c7eb1571d944cee942d43d160cb6547afa6e07", ) -BOUNCYCASTLE_VER = "1.77" +BOUNCYCASTLE_VER = "1.78.1" maven_jar( name = "bcpg", artifact = "org.bouncycastle:bcpg-jdk18on:" + BOUNCYCASTLE_VER, - sha1 = "bb0be51e8b378baae6e0d86f5282cd3887066539", - src_sha1 = "33ff3269cede7165dac44033a3b150cc9f9f11cf", + sha1 = "6c8dbcec20355278ec54840e735f63db2479150e", + src_sha1 = "2ddef60d84dd8c14ebce4c13100f0bc55fed6922", ) maven_jar( name = "bcprov", artifact = "org.bouncycastle:bcprov-jdk18on:" + BOUNCYCASTLE_VER, - sha1 = "2cc971b6c20949c1ff98d1a4bc741ee848a09523", - src_sha1 = "14ea9a3d759261358c6a1f59490ded125b5273a6", + sha1 = "39e9e45359e20998eb79c1828751f94a818d25f8", + src_sha1 = "70f58ec93da543dda6a21614b768cb2e386fd512", ) maven_jar( name = "bcutil", artifact = "org.bouncycastle:bcutil-jdk18on:" + BOUNCYCASTLE_VER, - sha1 = "de3eaef351545fe8562cf29ddff4a403a45b49b7", - src_sha1 = "6f8f56ab009e7a3204817a0d45ed9638f5e30116", + sha1 = "5353ca39fe2f148dab9ca1d637a43d0750456254", + src_sha1 = "8d2e0747f5d806f39a602f7f91610444d88c4e2c", ) maven_jar( name = "bcpkix", artifact = "org.bouncycastle:bcpkix-jdk18on:" + BOUNCYCASTLE_VER, - sha1 = "ed953791ba0229747dd0fd9911e3d76a462acfd3", - src_sha1 = "fdff397d5de0306db014f0a17e91717150db2768", + sha1 = "17b3541f736df97465f87d9f5b5dfa4991b37bb3", + src_sha1 = "3aeaf221772ad0c9c04593688cb86c6eb74d48b9", )
diff --git a/lib/BUILD b/lib/BUILD index 8806217..8918df8 100644 --- a/lib/BUILD +++ b/lib/BUILD
@@ -20,6 +20,16 @@ ) java_library( + name = "commons-lang3", + visibility = [ + "//org.eclipse.jgit.archive:__pkg__", + "//org.eclipse.jgit.pgm.test:__pkg__", + "//org.eclipse.jgit.test:__pkg__", + ], + exports = ["@commons-lang3//jar"], +) + +java_library( name = "commons-io", visibility = [ "//org.eclipse.jgit.archive:__pkg__",
diff --git a/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF index 44cf7b0..5c5c48d 100644 --- a/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF
@@ -5,13 +5,13 @@ Automatic-Module-Name: org.eclipse.jgit.ant.test Bundle-SymbolicName: org.eclipse.jgit.ant.test Bundle-Vendor: %Bundle-Vendor -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-11 Import-Package: org.apache.tools.ant, - org.eclipse.jgit.ant.tasks;version="[6.9.1,6.10.0)", - org.eclipse.jgit.junit;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lib;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util;version="[6.9.1,6.10.0)", + org.eclipse.jgit.ant.tasks;version="[6.10.2,6.11.0)", + org.eclipse.jgit.junit;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lib;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util;version="[6.10.2,6.11.0)", org.hamcrest.core;version="[1.1.0,3.0.0)", org.junit;version="[4.13,5.0.0)"
diff --git a/org.eclipse.jgit.ant.test/pom.xml b/org.eclipse.jgit.ant.test/pom.xml index f4049af..a370b90 100644 --- a/org.eclipse.jgit.ant.test/pom.xml +++ b/org.eclipse.jgit.ant.test/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.ant.test</artifactId>
diff --git a/org.eclipse.jgit.ant/META-INF/MANIFEST.MF b/org.eclipse.jgit.ant/META-INF/MANIFEST.MF index 7d416da..90aadf0 100644 --- a/org.eclipse.jgit.ant/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.ant/META-INF/MANIFEST.MF
@@ -3,13 +3,13 @@ Bundle-Name: %Bundle-Name Automatic-Module-Name: org.eclipse.jgit.ant Bundle-SymbolicName: org.eclipse.jgit.ant -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-11 Import-Package: org.apache.tools.ant, - org.eclipse.jgit.storage.file;version="[6.9.1,6.10.0)" + org.eclipse.jgit.storage.file;version="[6.10.2,6.11.0)" Bundle-Localization: OSGI-INF/l10n/plugin Bundle-Vendor: %Bundle-Vendor -Export-Package: org.eclipse.jgit.ant;version="6.9.1", - org.eclipse.jgit.ant.tasks;version="6.9.1"; +Export-Package: org.eclipse.jgit.ant;version="6.10.2", + org.eclipse.jgit.ant.tasks;version="6.10.2"; uses:="org.apache.tools.ant, org.apache.tools.ant.types"
diff --git a/org.eclipse.jgit.ant/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.ant/META-INF/SOURCE-MANIFEST.MF index 1ec6d78..98a3f1f 100644 --- a/org.eclipse.jgit.ant/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.ant/META-INF/SOURCE-MANIFEST.MF
@@ -3,5 +3,5 @@ Bundle-Name: org.eclipse.jgit.ant - Sources Bundle-SymbolicName: org.eclipse.jgit.ant.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 6.9.1.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.ant;version="6.9.1.qualifier";roots="." +Bundle-Version: 6.10.2.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.ant;version="6.10.2.qualifier";roots="."
diff --git a/org.eclipse.jgit.ant/pom.xml b/org.eclipse.jgit.ant/pom.xml index 6639067..fab0891 100644 --- a/org.eclipse.jgit.ant/pom.xml +++ b/org.eclipse.jgit.ant/pom.xml
@@ -15,7 +15,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.ant</artifactId>
diff --git a/org.eclipse.jgit.archive/BUILD b/org.eclipse.jgit.archive/BUILD index 3d7dbd2..d4f5340 100644 --- a/org.eclipse.jgit.archive/BUILD +++ b/org.eclipse.jgit.archive/BUILD
@@ -12,6 +12,7 @@ resources = glob(["resources/**"]), deps = [ "//lib:commons-compress", + "//lib:commons-lang3", # We want these deps to be provided_deps "//org.eclipse.jgit:jgit", ],
diff --git a/org.eclipse.jgit.archive/META-INF/MANIFEST.MF b/org.eclipse.jgit.archive/META-INF/MANIFEST.MF index ec7df3c..9d164d1 100644 --- a/org.eclipse.jgit.archive/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.archive/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-Name: %Bundle-Name Automatic-Module-Name: org.eclipse.jgit.archive Bundle-SymbolicName: org.eclipse.jgit.archive -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-Vendor: %Bundle-Vendor Bundle-Localization: OSGI-INF/l10n/plugin Bundle-RequiredExecutionEnvironment: JavaSE-11 @@ -13,17 +13,17 @@ org.apache.commons.compress.compressors.bzip2;version="[1.4,2.0)", org.apache.commons.compress.compressors.gzip;version="[1.4,2.0)", org.apache.commons.compress.compressors.xz;version="[1.4,2.0)", - org.eclipse.jgit.api;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lib;version="[6.9.1,6.10.0)", - org.eclipse.jgit.nls;version="[6.9.1,6.10.0)", - org.eclipse.jgit.revwalk;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util;version="[6.9.1,6.10.0)", + org.eclipse.jgit.api;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lib;version="[6.10.2,6.11.0)", + org.eclipse.jgit.nls;version="[6.10.2,6.11.0)", + org.eclipse.jgit.revwalk;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util;version="[6.10.2,6.11.0)", org.osgi.framework;version="[1.3.0,2.0.0)" Bundle-ActivationPolicy: lazy Bundle-Activator: org.eclipse.jgit.archive.FormatActivator -Export-Package: org.eclipse.jgit.archive;version="6.9.1"; +Export-Package: org.eclipse.jgit.archive;version="6.10.2"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.api, org.apache.commons.compress.archivers, org.osgi.framework", - org.eclipse.jgit.archive.internal;version="6.9.1";x-internal:=true + org.eclipse.jgit.archive.internal;version="6.10.2";x-internal:=true
diff --git a/org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF index f816946..89e5df0 100644 --- a/org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF
@@ -3,5 +3,5 @@ Bundle-Name: org.eclipse.jgit.archive - Sources Bundle-SymbolicName: org.eclipse.jgit.archive.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 6.9.1.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.archive;version="6.9.1.qualifier";roots="." +Bundle-Version: 6.10.2.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.archive;version="6.10.2.qualifier";roots="."
diff --git a/org.eclipse.jgit.archive/pom.xml b/org.eclipse.jgit.archive/pom.xml index ed2a64c..e6a2411 100644 --- a/org.eclipse.jgit.archive/pom.xml +++ b/org.eclipse.jgit.archive/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.archive</artifactId>
diff --git a/org.eclipse.jgit.benchmarks/pom.xml b/org.eclipse.jgit.benchmarks/pom.xml index 614f346..03c78ca 100644 --- a/org.eclipse.jgit.benchmarks/pom.xml +++ b/org.eclipse.jgit.benchmarks/pom.xml
@@ -16,7 +16,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.benchmarks</artifactId>
diff --git a/org.eclipse.jgit.coverage/pom.xml b/org.eclipse.jgit.coverage/pom.xml index 8c97734..3ed641c 100644 --- a/org.eclipse.jgit.coverage/pom.xml +++ b/org.eclipse.jgit.coverage/pom.xml
@@ -14,7 +14,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> @@ -27,88 +27,88 @@ <dependency> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </dependency> <dependency> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit.ant</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </dependency> <dependency> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit.archive</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </dependency> <dependency> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit.http.apache</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </dependency> <dependency> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit.http.server</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </dependency> <dependency> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit.lfs</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </dependency> <dependency> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit.lfs.server</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </dependency> <dependency> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit.pgm</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </dependency> <dependency> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit.ui</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </dependency> <dependency> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit.ssh.apache</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </dependency> <dependency> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit.test</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </dependency> <dependency> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit.ant.test</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </dependency> <dependency> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit.http.test</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </dependency> <dependency> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit.pgm.test</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </dependency> <dependency> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit.lfs.test</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </dependency> <dependency> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit.lfs.server.test</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </dependency> <dependency> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit.ssh.apache.test</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </dependency> </dependencies>
diff --git a/org.eclipse.jgit.gpg.bc.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.gpg.bc.test/META-INF/MANIFEST.MF index ba4acf1..5bcd749 100644 --- a/org.eclipse.jgit.gpg.bc.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.gpg.bc.test/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-Name: %Bundle-Name Automatic-Module-Name: org.eclipse.jgit.gpg.bc.test Bundle-SymbolicName: org.eclipse.jgit.gpg.bc.test -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-Vendor: %Bundle-Vendor Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-11 @@ -13,9 +13,9 @@ org.bouncycastle.openpgp.operator;version="[1.65.0,2.0.0)", org.bouncycastle.openpgp.operator.jcajce;version="[1.65.0,2.0.0)", org.bouncycastle.util.encoders;version="[1.65.0,2.0.0)", - org.eclipse.jgit.gpg.bc.internal;version="[6.9.1,6.10.0)", - org.eclipse.jgit.gpg.bc.internal.keys;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util.sha1;version="[6.9.1,6.10.0)", + org.eclipse.jgit.gpg.bc.internal;version="[6.10.2,6.11.0)", + org.eclipse.jgit.gpg.bc.internal.keys;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util.sha1;version="[6.10.2,6.11.0)", org.junit;version="[4.13,5.0.0)", org.junit.runner;version="[4.13,5.0.0)", org.junit.runners;version="[4.13,5.0.0)"
diff --git a/org.eclipse.jgit.gpg.bc.test/pom.xml b/org.eclipse.jgit.gpg.bc.test/pom.xml index d62beda..f674ded 100644 --- a/org.eclipse.jgit.gpg.bc.test/pom.xml +++ b/org.eclipse.jgit.gpg.bc.test/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.gpg.bc.test</artifactId>
diff --git a/org.eclipse.jgit.gpg.bc.test/tst-rsrc/org/eclipse/jgit/gpg/bc/internal/keys/62D43D7F117F7A5E4998ECB6617EE9942D069C14.asc b/org.eclipse.jgit.gpg.bc.test/tst-rsrc/org/eclipse/jgit/gpg/bc/internal/keys/62D43D7F117F7A5E4998ECB6617EE9942D069C14.asc new file mode 100644 index 0000000..ee8207e --- /dev/null +++ b/org.eclipse.jgit.gpg.bc.test/tst-rsrc/org/eclipse/jgit/gpg/bc/internal/keys/62D43D7F117F7A5E4998ECB6617EE9942D069C14.asc
@@ -0,0 +1,9 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mDMEZet5vRYJKwYBBAHaRw8BAQdA1lUwXTD4ia1i4+ckhPr0O0a9aQAarg6U8prB +6H85XJG0GFRlc3RlciA8dGVzdGVyQHRlc3QuY29tPoiQBBMWCgA4FiEEwLQ/UWQ8 +ydO7u8ea7hn0dWq7fbwFAmXreb0CGwEFCwkIBwMFFQoJCAsFFgIDAQACHgECF4AA +CgkQ7hn0dWq7fbxhPwEA3a0COi4sV7Uxd91H9P5DXJA2XzYtyvYsxZJEICFZPo8B +AO6fF9Ii5ATO5USSMf6bNCevcBlDFBNXIO+pwjemrBYJ +=LYEV +-----END PGP PUBLIC KEY BLOCK-----
diff --git a/org.eclipse.jgit.gpg.bc.test/tst-rsrc/org/eclipse/jgit/gpg/bc/internal/keys/62D43D7F117F7A5E4998ECB6617EE9942D069C14.key b/org.eclipse.jgit.gpg.bc.test/tst-rsrc/org/eclipse/jgit/gpg/bc/internal/keys/62D43D7F117F7A5E4998ECB6617EE9942D069C14.key new file mode 100644 index 0000000..03ed01c --- /dev/null +++ b/org.eclipse.jgit.gpg.bc.test/tst-rsrc/org/eclipse/jgit/gpg/bc/internal/keys/62D43D7F117F7A5E4998ECB6617EE9942D069C14.key
@@ -0,0 +1,7 @@ +Key: (protected-private-key (ecc (curve Ed25519)(flags eddsa)(q + #40D655305D30F889AD62E3E72484FAF43B46BD69001AAE0E94F29AC1E87F395C91#) + (protected openpgp-s2k3-ocb-aes ((sha1 #EBA45EE5104E7ED6# + "24672256")#36CB86BDBEA4947789F555B6#)#2D3CBB52F66DED8E0E7B0A1FEE9732 + 4FC1624B32069CD1ED507877E26B3099E62C2AC615DA7E8DAAD335EC613AD2CD9B89C4 + D1BCDEADEA3C67785428#)(protected-at "20240308T204911"))) +Created: 20240308T204901
diff --git a/org.eclipse.jgit.gpg.bc.test/tst/org/eclipse/jgit/gpg/bc/internal/keys/SecretKeysTest.java b/org.eclipse.jgit.gpg.bc.test/tst/org/eclipse/jgit/gpg/bc/internal/keys/SecretKeysTest.java index 5e5e303..fed0610 100644 --- a/org.eclipse.jgit.gpg.bc.test/tst/org/eclipse/jgit/gpg/bc/internal/keys/SecretKeysTest.java +++ b/org.eclipse.jgit.gpg.bc.test/tst/org/eclipse/jgit/gpg/bc/internal/keys/SecretKeysTest.java
@@ -97,6 +97,7 @@ public String toString() { new TestData("2FB05DBB70FC07CB84C13431F640CA6CEA1DBF8A", false, true), new TestData("66CCECEC2AB46A9735B10FEC54EDF9FD0F77BAF9", true, true), new TestData("F727FAB884DA3BD402B6E0F5472E108D21033124", true, true), + new TestData("62D43D7F117F7A5E4998ECB6617EE9942D069C14", true, true), new TestData("faked", false, true) }; } @@ -152,7 +153,7 @@ public void testKeyRead() throws Exception { assertNotNull(secretKey); } catch (PGPException e) { // Currently we may not be able to load OCB-encrypted keys. - assertTrue(e.getMessage().contains("OCB")); + assertTrue(e.toString(), e.getMessage().contains("OCB")); assertTrue(data.encrypted); assertFalse(ocbAvailable()); }
diff --git a/org.eclipse.jgit.gpg.bc/META-INF/MANIFEST.MF b/org.eclipse.jgit.gpg.bc/META-INF/MANIFEST.MF index d27c9de..8d72ff2 100644 --- a/org.eclipse.jgit.gpg.bc/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.gpg.bc/META-INF/MANIFEST.MF
@@ -3,13 +3,12 @@ Bundle-Name: %Bundle-Name Automatic-Module-Name: org.eclipse.jgit.gpg.bc Bundle-SymbolicName: org.eclipse.jgit.gpg.bc;singleton:=true -Fragment-Host: org.eclipse.jgit;bundle-version="[6.9.1,6.10.0)" +Fragment-Host: org.eclipse.jgit;bundle-version="[6.10.2,6.11.0)" Bundle-Vendor: %Bundle-Vendor Bundle-Localization: OSGI-INF/l10n/gpg_bc -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-11 Import-Package: org.bouncycastle.asn1;version="[1.69.0,2.0.0)", - org.bouncycastle.asn1.cryptlib;version="[1.69.0,2.0.0)", org.bouncycastle.asn1.x9;version="[1.69.0,2.0.0)", org.bouncycastle.bcpg;version="[1.69.0,2.0.0)", org.bouncycastle.bcpg.sig;version="[1.69.0,2.0.0)", @@ -29,9 +28,9 @@ org.bouncycastle.util;version="[1.69.0,2.0.0)", org.bouncycastle.util.encoders;version="[1.69.0,2.0.0)", org.bouncycastle.util.io;version="[1.69.0,2.0.0)", - org.eclipse.jgit.annotations;version="[6.9.1,6.10.0)", - org.eclipse.jgit.api.errors;version="[6.9.1,6.10.0)", + org.eclipse.jgit.annotations;version="[6.10.2,6.11.0)", + org.eclipse.jgit.api.errors;version="[6.10.2,6.11.0)", org.slf4j;version="[1.7.0,3.0.0)" -Export-Package: org.eclipse.jgit.gpg.bc;version="6.9.1", - org.eclipse.jgit.gpg.bc.internal;version="6.9.1";x-friends:="org.eclipse.jgit.gpg.bc.test", - org.eclipse.jgit.gpg.bc.internal.keys;version="6.9.1";x-friends:="org.eclipse.jgit.gpg.bc.test" +Export-Package: org.eclipse.jgit.gpg.bc;version="6.10.2", + org.eclipse.jgit.gpg.bc.internal;version="6.10.2";x-friends:="org.eclipse.jgit.gpg.bc.test", + org.eclipse.jgit.gpg.bc.internal.keys;version="6.10.2";x-friends:="org.eclipse.jgit.gpg.bc.test"
diff --git a/org.eclipse.jgit.gpg.bc/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.gpg.bc/META-INF/SOURCE-MANIFEST.MF index 2e1149a..b440342 100644 --- a/org.eclipse.jgit.gpg.bc/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.gpg.bc/META-INF/SOURCE-MANIFEST.MF
@@ -3,5 +3,5 @@ Bundle-Name: org.eclipse.jgit.gpg.bc - Sources Bundle-SymbolicName: org.eclipse.jgit.gpg.bc.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 6.9.1.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.gpg.bc;version="6.9.1.qualifier";roots="." +Bundle-Version: 6.10.2.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.gpg.bc;version="6.10.2.qualifier";roots="."
diff --git a/org.eclipse.jgit.gpg.bc/pom.xml b/org.eclipse.jgit.gpg.bc/pom.xml index 191a6cf..6f4d5af 100644 --- a/org.eclipse.jgit.gpg.bc/pom.xml +++ b/org.eclipse.jgit.gpg.bc/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.gpg.bc</artifactId>
diff --git a/org.eclipse.jgit.gpg.bc/resources/org/eclipse/jgit/gpg/bc/internal/BCText.properties b/org.eclipse.jgit.gpg.bc/resources/org/eclipse/jgit/gpg/bc/internal/BCText.properties index ab83298..77ca2cd 100644 --- a/org.eclipse.jgit.gpg.bc/resources/org/eclipse/jgit/gpg/bc/internal/BCText.properties +++ b/org.eclipse.jgit.gpg.bc/resources/org/eclipse/jgit/gpg/bc/internal/BCText.properties
@@ -29,6 +29,7 @@ signatureKeyLookupError=Error occurred while looking for public key signatureNoKeyInfo=No way to determine a public key from the signature signatureNoPublicKey=No public key found to verify the signature +signatureNoSigningKey=No signing key found for key fingerprint {0} signatureParseError=Signature cannot be parsed signatureVerificationError=Signature verification failed unableToSignCommitNoSecretKey=Unable to sign commit. Signing key not available.
diff --git a/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/BCText.java b/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/BCText.java index 4349984..705e195 100644 --- a/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/BCText.java +++ b/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/BCText.java
@@ -59,6 +59,7 @@ public static BCText get() { /***/ public String signatureKeyLookupError; /***/ public String signatureNoKeyInfo; /***/ public String signatureNoPublicKey; + /***/ public String signatureNoSigningKey; /***/ public String signatureParseError; /***/ public String signatureVerificationError; /***/ public String unableToSignCommitNoSecretKey;
diff --git a/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/BouncyCastleGpgKeyLocator.java b/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/BouncyCastleGpgKeyLocator.java index e9032a8..970e7df 100644 --- a/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/BouncyCastleGpgKeyLocator.java +++ b/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/BouncyCastleGpgKeyLocator.java
@@ -27,10 +27,14 @@ import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collections; import java.util.Iterator; +import java.util.List; import java.util.Locale; import java.util.function.Consumer; import java.util.function.Function; +import java.util.stream.Collectors; import org.bouncycastle.gpg.keybox.BlobType; import org.bouncycastle.gpg.keybox.KeyBlob; @@ -268,9 +272,11 @@ private static String toFingerprint(String keyId) { return keyId; } - static PGPPublicKey findPublicKey(String fingerprint, String keySpec) + static BouncyCastleGpgPublicKey findPublicKey(String fingerprint, + String keySpec) throws IOException, PGPException { - PGPPublicKey result = findPublicKeyInPubring(USER_PGP_PUBRING_FILE, + BouncyCastleGpgPublicKey result = findPublicKeyInPubring( + USER_PGP_PUBRING_FILE, fingerprint, keySpec); if (result == null && exists(USER_KEYBOX_PATH)) { try { @@ -330,7 +336,8 @@ private static PGPPublicKey findPublicKeyByUserId(KeyBlob keyBlob, * @throws NoOpenPgpKeyException * if the file does not contain any OpenPGP key */ - private static PGPPublicKey findPublicKeyInKeyBox(Path keyboxFile, + private static BouncyCastleGpgPublicKey findPublicKeyInKeyBox( + Path keyboxFile, String keyId, String keySpec) throws IOException, NoSuchAlgorithmException, NoSuchProviderException, NoOpenPgpKeyException { @@ -343,11 +350,16 @@ private static PGPPublicKey findPublicKeyInKeyBox(Path keyboxFile, hasOpenPgpKey = true; PGPPublicKey key = findPublicKeyByKeyId(keyBlob, id); if (key != null) { - return key; + if (!isSigningKey(key)) { + return null; + } + return new BouncyCastleGpgPublicKey(key, true, + toStrings(keyBlob.getUserIds())); } key = findPublicKeyByUserId(keyBlob, keySpec); if (key != null) { - return key; + return new BouncyCastleGpgPublicKey(key, true, + toStrings(keyBlob.getUserIds())); } } } @@ -357,6 +369,14 @@ private static PGPPublicKey findPublicKeyInKeyBox(Path keyboxFile, return null; } + private static List<String> toStrings(List<UserID> userIds) { + if (userIds == null) { + return Collections.emptyList(); + } + return userIds.stream().map(UserID::getUserIDAsString) + .collect(Collectors.toList()); + } + /** * If there is a private key directory containing keys, use pubring.kbx or * pubring.gpg to find the public key; then try to find the secret key in @@ -387,7 +407,7 @@ public BouncyCastleGpgKey findSecretKey() throws IOException, NoSuchAlgorithmException, NoSuchProviderException, PGPException, CanceledException, UnsupportedCredentialItem, URISyntaxException { BouncyCastleGpgKey key; - PGPPublicKey publicKey = null; + BouncyCastleGpgPublicKey publicKey = null; if (hasKeyFiles(USER_SECRET_KEY_DIR)) { // Use pubring.kbx or pubring.gpg to find the public key, then try // the key files in the directory. If the public key was found in @@ -397,14 +417,15 @@ public BouncyCastleGpgKey findSecretKey() throws IOException, publicKey = findPublicKeyInKeyBox(USER_KEYBOX_PATH, null, signingKey); if (publicKey != null) { - key = findSecretKeyForKeyBoxPublicKey(publicKey, - USER_KEYBOX_PATH); + key = findSecretKeyForKeyBoxPublicKey( + publicKey.getPublicKey(), USER_KEYBOX_PATH); if (key != null) { return key; } throw new PGPException(MessageFormat.format( BCText.get().gpgNoSecretKeyForPublicKey, - Long.toHexString(publicKey.getKeyID()))); + Long.toHexString( + publicKey.getPublicKey().getKeyID()))); } throw new PGPException(MessageFormat.format( BCText.get().gpgNoPublicKeyFound, signingKey)); @@ -427,7 +448,8 @@ public BouncyCastleGpgKey findSecretKey() throws IOException, // secring.gpg at all, even if it exists. Which means for us // we have to try both since we don't know which GPG version // the user has. - key = findSecretKeyForKeyBoxPublicKey(publicKey, + key = findSecretKeyForKeyBoxPublicKey( + publicKey.getPublicKey(), USER_PGP_PUBRING_FILE); if (key != null) { return key; @@ -452,7 +474,7 @@ public BouncyCastleGpgKey findSecretKey() throws IOException, if (publicKey != null) { throw new PGPException(MessageFormat.format( BCText.get().gpgNoSecretKeyForPublicKey, - Long.toHexString(publicKey.getKeyID()))); + Long.toHexString(publicKey.getPublicKey().getKeyID()))); } else if (hasSecring) { // publicKey == null: user has _only_ pubring.gpg/secring.gpg. throw new PGPException(MessageFormat.format( @@ -614,40 +636,88 @@ private PGPSecretKey findSecretKeyInLegacySecring(String signingKeyName, * @throws PGPException * on BouncyCastle errors */ - private static PGPPublicKey findPublicKeyInPubring(Path pubringFile, + private static BouncyCastleGpgPublicKey findPublicKeyInPubring( + Path pubringFile, String keyId, String keySpec) throws IOException, PGPException { try (InputStream in = newInputStream(pubringFile)) { PGPPublicKeyRingCollection pgpPub = new PGPPublicKeyRingCollection( new BufferedInputStream(in), new JcaKeyFingerprintCalculator()); - String id = keyId != null ? keyId : toFingerprint(keySpec).toLowerCase(Locale.ROOT); Iterator<PGPPublicKeyRing> keyrings = pgpPub.getKeyRings(); + BouncyCastleGpgPublicKey candidate = null; while (keyrings.hasNext()) { PGPPublicKeyRing keyRing = keyrings.next(); - Iterator<PGPPublicKey> keys = keyRing.getPublicKeys(); - while (keys.hasNext()) { - PGPPublicKey key = keys.next(); - // try key id - String fingerprint = Hex.toHexString(key.getFingerprint()) - .toLowerCase(Locale.ROOT); - if (fingerprint.endsWith(id)) { - return key; - } - // try user id - Iterator<String> userIDs = key.getUserIDs(); - while (userIDs.hasNext()) { - String userId = userIDs.next(); - if (containsSigningKey(userId, keySpec)) { - return key; - } + BouncyCastleGpgPublicKey newCandidate = findPublicKeyInPubring( + keyRing, id, keySpec); + if (newCandidate != null) { + if (newCandidate.isExactMatch()) { + return newCandidate; + } else if (candidate == null) { + candidate = newCandidate; } } } + return candidate; } catch (FileNotFoundException | NoSuchFileException e) { - // Ignore and return null + return null; + } + } + + private static BouncyCastleGpgPublicKey findPublicKeyInPubring( + PGPPublicKeyRing keyRing, String keyId, String keySpec) { + Iterator<PGPPublicKey> keys = keyRing.getPublicKeys(); + if (!keys.hasNext()) { + return null; + } + PGPPublicKey masterKey = keys.next(); + String fingerprint = Hex.toHexString(masterKey.getFingerprint()) + .toLowerCase(Locale.ROOT); + boolean masterFingerprintMatch = false; + boolean userIdMatch = false; + List<String> userIds = new ArrayList<>(); + masterKey.getUserIDs().forEachRemaining(userIds::add); + if (fingerprint.endsWith(keyId)) { + masterFingerprintMatch = true; + } else { + // Check the user IDs + for (String userId : userIds) { + if (containsSigningKey(userId, keySpec)) { + userIdMatch = true; + break; + } + } + } + if (masterFingerprintMatch) { + if (isSigningKey(masterKey)) { + return new BouncyCastleGpgPublicKey(masterKey, true, userIds); + } + } + // Check subkeys -- they have no user ids, so only check for a + // fingerprint match (unless the master key matched). + PGPPublicKey candidate = null; + while (keys.hasNext()) { + PGPPublicKey subKey = keys.next(); + if (!isSigningKey(subKey)) { + continue; + } + if (masterFingerprintMatch) { + candidate = subKey; + break; + } + fingerprint = Hex.toHexString(subKey.getFingerprint()) + .toLowerCase(Locale.ROOT); + if (fingerprint.endsWith(keyId)) { + return new BouncyCastleGpgPublicKey(subKey, true, userIds); + } + if (candidate == null) { + candidate = subKey; + } + } + if (candidate != null && (masterFingerprintMatch || userIdMatch)) { + return new BouncyCastleGpgPublicKey(candidate, false, userIds); } return null; }
diff --git a/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/BouncyCastleGpgPublicKey.java b/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/BouncyCastleGpgPublicKey.java new file mode 100644 index 0000000..d736536 --- /dev/null +++ b/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/BouncyCastleGpgPublicKey.java
@@ -0,0 +1,36 @@ +package org.eclipse.jgit.gpg.bc.internal; + +import java.util.List; + +import org.bouncycastle.openpgp.PGPPublicKey; + +/** + * Container for GPG public keys. + */ +class BouncyCastleGpgPublicKey { + + private final PGPPublicKey publicKey; + + private final boolean exactMatch; + + private final List<String> userIds; + + BouncyCastleGpgPublicKey(PGPPublicKey publicKey, boolean exactMatch, + List<String> userIds) { + this.publicKey = publicKey; + this.exactMatch = exactMatch; + this.userIds = userIds; + } + + PGPPublicKey getPublicKey() { + return publicKey; + } + + boolean isExactMatch() { + return exactMatch; + } + + List<String> getUserIds() { + return userIds; + } +}
diff --git a/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/BouncyCastleGpgSignatureVerifier.java b/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/BouncyCastleGpgSignatureVerifier.java index f4fed40..3378bb3 100644 --- a/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/BouncyCastleGpgSignatureVerifier.java +++ b/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/BouncyCastleGpgSignatureVerifier.java
@@ -16,7 +16,7 @@ import java.text.MessageFormat; import java.time.Instant; import java.util.Date; -import java.util.Iterator; +import java.util.List; import java.util.Locale; import org.bouncycastle.bcpg.sig.IssuerFingerprint; @@ -121,7 +121,7 @@ public SignatureVerification verify(@NonNull GpgConfig config, byte[] data, } else { throw new JGitInternalException(BCText.get().nonSignatureError); } - } catch (PGPException e) { + } catch (NumberFormatException | PGPException e) { throw new JGitInternalException(BCText.get().signatureParseError, e); } @@ -134,7 +134,7 @@ public SignatureVerification verify(@NonNull GpgConfig config, byte[] data, if (fingerprint != null && keyId != null && !fingerprint.endsWith(keyId)) { return new VerificationResult(signatureCreatedAt, signer, fingerprint, - null, false, false, TrustLevel.UNKNOWN, + signer, false, false, TrustLevel.UNKNOWN, MessageFormat.format(BCText.get().signatureInconsistent, keyId, fingerprint)); } @@ -144,18 +144,18 @@ public SignatureVerification verify(@NonNull GpgConfig config, byte[] data, // Try to find the public key String keySpec = '<' + signer + '>'; Object cached = null; - PGPPublicKey publicKey = null; + BouncyCastleGpgPublicKey publicKey = null; try { cached = byFingerprint.get(fingerprint); if (cached != null) { - if (cached instanceof PGPPublicKey) { - publicKey = (PGPPublicKey) cached; + if (cached instanceof BouncyCastleGpgPublicKey) { + publicKey = (BouncyCastleGpgPublicKey) cached; } } else if (!StringUtils.isEmptyOrNull(signer)) { cached = bySigner.get(signer); if (cached != null) { - if (cached instanceof PGPPublicKey) { - publicKey = (PGPPublicKey) cached; + if (cached instanceof BouncyCastleGpgPublicKey) { + publicKey = (BouncyCastleGpgPublicKey) cached; } } } @@ -176,9 +176,17 @@ public SignatureVerification verify(@NonNull GpgConfig config, byte[] data, } } return new VerificationResult(signatureCreatedAt, signer, - fingerprint, null, false, false, TrustLevel.UNKNOWN, + fingerprint, signer, false, false, TrustLevel.UNKNOWN, BCText.get().signatureNoPublicKey); } + if (fingerprint != null && !publicKey.isExactMatch()) { + // We did find _some_ signing key for the signer, but it doesn't + // match the given fingerprint. + return new VerificationResult(signatureCreatedAt, signer, + fingerprint, signer, false, false, TrustLevel.UNKNOWN, + MessageFormat.format(BCText.get().signatureNoSigningKey, + fingerprint)); + } if (cached == null) { byFingerprint.put(fingerprint, publicKey); byFingerprint.put(keyId, publicKey); @@ -187,27 +195,28 @@ public SignatureVerification verify(@NonNull GpgConfig config, byte[] data, } } String user = null; - Iterator<String> userIds = publicKey.getUserIDs(); - if (!StringUtils.isEmptyOrNull(signer)) { - while (userIds.hasNext()) { - String userId = userIds.next(); - if (BouncyCastleGpgKeyLocator.containsSigningKey(userId, - keySpec)) { - user = userId; - break; + List<String> userIds = publicKey.getUserIds(); + if (userIds != null && !userIds.isEmpty()) { + if (!StringUtils.isEmptyOrNull(signer)) { + for (String userId : publicKey.getUserIds()) { + if (BouncyCastleGpgKeyLocator.containsSigningKey(userId, + keySpec)) { + user = userId; + break; + } } } - } - if (user == null) { - userIds = publicKey.getUserIDs(); - if (userIds.hasNext()) { - user = userIds.next(); + if (user == null) { + user = userIds.get(0); } + } else if (signer != null) { + user = signer; } + PGPPublicKey pubKey = publicKey.getPublicKey(); boolean expired = false; - long validFor = publicKey.getValidSeconds(); + long validFor = pubKey.getValidSeconds(); if (validFor > 0 && signatureCreatedAt != null) { - Instant expiredAt = publicKey.getCreationTime().toInstant() + Instant expiredAt = pubKey.getCreationTime().toInstant() .plusSeconds(validFor); expired = expiredAt.isBefore(signatureCreatedAt.toInstant()); } @@ -215,14 +224,14 @@ public SignatureVerification verify(@NonNull GpgConfig config, byte[] data, // specific. We don't use the GPG trustdb but simply the trust packet // on the public key, if present. Even if present, it may or may not // be set. - byte[] trustData = publicKey.getTrustData(); + byte[] trustData = pubKey.getTrustData(); TrustLevel trust = parseGpgTrustPacket(trustData); boolean verified = false; try { signature.init( new JcaPGPContentVerifierBuilderProvider() .setProvider(BouncyCastleProvider.PROVIDER_NAME), - publicKey); + pubKey); signature.update(data); verified = signature.verify(); } catch (PGPException e) {
diff --git a/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/keys/KeyGrip.java b/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/keys/KeyGrip.java index 3eee18a..9b5d592 100644 --- a/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/keys/KeyGrip.java +++ b/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/keys/KeyGrip.java
@@ -43,17 +43,6 @@ */ public final class KeyGrip { - // Some OIDs apparently unknown to BouncyCastle. - - private static String OID_OPENPGP_ED25519 = "1.3.6.1.4.1.11591.15.1"; //$NON-NLS-1$ - - private static String OID_RFC8410_CURVE25519 = "1.3.101.110"; //$NON-NLS-1$ - - private static String OID_RFC8410_ED25519 = "1.3.101.112"; //$NON-NLS-1$ - - private static ASN1ObjectIdentifier CURVE25519 = ECNamedCurveTable - .getOID("curve25519"); //$NON-NLS-1$ - private KeyGrip() { // No instantiation } @@ -99,20 +88,15 @@ private KeyGrip() { break; case PublicKeyAlgorithmTags.ECDH: case PublicKeyAlgorithmTags.ECDSA: - case PublicKeyAlgorithmTags.EDDSA: + case PublicKeyAlgorithmTags.EDDSA_LEGACY: + case PublicKeyAlgorithmTags.Ed25519: ECPublicBCPGKey ec = (ECPublicBCPGKey) publicKey .getPublicKeyPacket().getKey(); ASN1ObjectIdentifier curveOID = ec.getCurveOID(); // BC doesn't know these OIDs. - if (OID_OPENPGP_ED25519.equals(curveOID.getId()) - || OID_RFC8410_ED25519.equals(curveOID.getId())) { + if (ObjectIds.isEd25519(curveOID)) { return hashEd25519(grip, ec.getEncodedPoint()); - } else if (CURVE25519.equals(curveOID) - || OID_RFC8410_CURVE25519.equals(curveOID.getId())) { - // curvey25519 actually is the OpenPGP OID for Curve25519 and is - // known to BC, but the parameters are for the short Weierstrass - // form. See https://github.com/bcgit/bc-java/issues/399 . - // libgcrypt uses Montgomery form. + } else if (ObjectIds.isCurve25519(curveOID)) { return hashCurve25519(grip, ec.getEncodedPoint()); } X9ECParameters params = getX9Parameters(curveOID); @@ -141,7 +125,9 @@ private KeyGrip() { hash(grip, b.toByteArray(), 'b', false); hash(grip, g, 'g', false); hash(grip, n.toByteArray(), 'n', false); - if (publicKey.getAlgorithm() == PublicKeyAlgorithmTags.EDDSA) { + int algorithm = publicKey.getAlgorithm(); + if (algorithm == PublicKeyAlgorithmTags.EDDSA_LEGACY + || algorithm == PublicKeyAlgorithmTags.Ed25519) { hashQ25519(grip, q); } else { hash(grip, q.toByteArray(), 'q', false);
diff --git a/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/keys/ObjectIds.java b/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/keys/ObjectIds.java new file mode 100644 index 0000000..3d30981 --- /dev/null +++ b/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/keys/ObjectIds.java
@@ -0,0 +1,109 @@ +/* + * Copyright (C) 2024, Thomas Wolf <twolf@apache.org> and others + * + * 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.gpg.bc.internal.keys; + +import org.bouncycastle.asn1.ASN1ObjectIdentifier; +import org.bouncycastle.asn1.x9.ECNamedCurveTable; + +/** + * Some OIDs apparently unknown to Bouncy Castle. + */ +public final class ObjectIds { + + /** + * Legacy OID for ed25519 used in OpenPGP. + */ + public static final ASN1ObjectIdentifier OID_OPENPGP_ED25519 = + new ASN1ObjectIdentifier("1.3.6.1.4.1.11591.15.1"); //$NON-NLS-1$ + + /** + * OID for ed25519 according to RFC 8410. + */ + public static final ASN1ObjectIdentifier OID_RFC8410_ED25519 = + new ASN1ObjectIdentifier("1.3.101.112"); //$NON-NLS-1$ + + /** + * Legacy OID for curve25519 used in OpenPGP. + */ + public static final ASN1ObjectIdentifier OID_OPENPGP_CURVE25519 = + ECNamedCurveTable.getOID("curve25519"); //$NON-NLS-1$ + // This is 1.3.6.1.4.1.3029.1.5.1 + + /** + * OID for curve25519 according to RFC 8410. + */ + public static final ASN1ObjectIdentifier OID_RFC8410_CURVE25519 = new ASN1ObjectIdentifier( + "1.3.101.110"); //$NON-NLS-1$ + + /** + * Determines whether the given {@code oid} denoted ed25519. + * + * @param oid + * to test + * @return {@code true} if it is ed25519, {@code false} otherwise + */ + public static boolean isEd25519(ASN1ObjectIdentifier oid) { + return OID_OPENPGP_ED25519.equals(oid) + || OID_RFC8410_ED25519.equals(oid); + } + + /** + * Determines whether the given {@code oid} denoted curve25519. + * + * @param oid + * to test + * @return {@code true} if it is curve25519, {@code false} otherwise + */ + public static boolean isCurve25519(ASN1ObjectIdentifier oid) { + return OID_RFC8410_CURVE25519.equals(oid) + || OID_OPENPGP_CURVE25519.equals(oid); + } + + /** + * Retrieves an OID by name. + * + * @param name + * to get the OID for + * @return the OID, or {@code null} if unknown. + */ + public static ASN1ObjectIdentifier getByName(String name) { + if (name != null) { + switch (name) { + case "Ed25519": //$NON-NLS-1$ + return OID_OPENPGP_ED25519; + case "Curve25519": //$NON-NLS-1$ + return OID_OPENPGP_CURVE25519; + default: + break; + } + } + return null; + } + + /** + * Checks whether two OIDs denote the same algorithm. + * + * @param oid1 + * First OID to test + * @param oid2 + * Second OID to test + * @return {@code true} if the two OIDs match, {@code false} otherwise + */ + public static boolean match(ASN1ObjectIdentifier oid1, + ASN1ObjectIdentifier oid2) { + if (isEd25519(oid1)) { + return isEd25519(oid2); + } + if (isCurve25519(oid1)) { + return isCurve25519(oid2); + } + return oid1 != null && oid1.equals(oid2); + } +}
diff --git a/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/keys/SExprParser.java b/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/keys/SExprParser.java index c93c216..fd030ee 100644 --- a/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/keys/SExprParser.java +++ b/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/keys/SExprParser.java
@@ -30,6 +30,7 @@ import java.math.BigInteger; import java.util.Date; +import org.bouncycastle.asn1.ASN1ObjectIdentifier; import org.bouncycastle.asn1.x9.ECNamedCurveTable; import org.bouncycastle.bcpg.DSAPublicBCPGKey; import org.bouncycastle.bcpg.DSASecretBCPGKey; @@ -62,9 +63,12 @@ * modified by the JGit team to: * <ul> * <li>handle unencrypted DSA, EC, and ElGamal keys (upstream only handles - * unencrypted RSA), and</li> + * unencrypted RSA)</li> * <li>handle secret keys using AES/OCB as encryption (those don't have a - * hash).</li> + * hash)</li> + * <li>fix EC parsing to account for "flags" sub-list present for ed25519 and + * curve25519</li> + * <li>add support for ed25519 OIDs unknown to BouncyCastle</li> * </ul> */ @SuppressWarnings("nls") @@ -128,6 +132,15 @@ public PGPSecretKey parseSecretKey(InputStream inputStream, SXprUtils.skipOpenParenthesis(inputStream); type = SXprUtils.readString(inputStream, inputStream.read()); + // JGit: c.f. https://github.com/bcgit/bc-java/issues/1590. + // There may be a flags sub-list here for ed25519 or curve25519. + if (type.equals("flags")) { + SXprUtils.readString(inputStream, inputStream.read()); + SXprUtils.skipCloseParenthesis(inputStream); + SXprUtils.skipOpenParenthesis(inputStream); + type = SXprUtils.readString(inputStream, + inputStream.read()); + } if (type.equals("q")) { qVal = SXprUtils.readBytes(inputStream, inputStream.read()); } else { @@ -143,12 +156,19 @@ public PGPSecretKey parseSecretKey(InputStream inputStream, curveName = curveName.substring("NIST ".length()); } + // JGit: BC doesn't know Ed25519 curve name. + ASN1ObjectIdentifier curveOid = ECNamedCurveTable + .getOID(curveName); + if (curveOid == null) { + curveOid = ObjectIds.getByName(curveName); + } ECPublicBCPGKey basePubKey = new ECDSAPublicBCPGKey( - ECNamedCurveTable.getOID(curveName), + curveOid, new BigInteger(1, qVal)); ECPublicBCPGKey assocPubKey = (ECPublicBCPGKey) pubKey .getPublicKeyPacket().getKey(); - if (!basePubKey.getCurveOID().equals(assocPubKey.getCurveOID()) + if (!ObjectIds.match(basePubKey.getCurveOID(), + assocPubKey.getCurveOID()) || !basePubKey.getEncodedPoint() .equals(assocPubKey.getEncodedPoint())) { throw new PGPException( @@ -292,6 +312,15 @@ public PGPSecretKey parseSecretKey(InputStream inputStream, SXprUtils.skipOpenParenthesis(inputStream); type = SXprUtils.readString(inputStream, inputStream.read()); + // JGit: c.f. https://github.com/bcgit/bc-java/issues/1590. + // There may be a flags sub-list here for ed25519 or curve25519. + if (type.equals("flags")) { + SXprUtils.readString(inputStream, inputStream.read()); + SXprUtils.skipCloseParenthesis(inputStream); + SXprUtils.skipOpenParenthesis(inputStream); + type = SXprUtils.readString(inputStream, + inputStream.read()); + } if (type.equals("q")) { qVal = SXprUtils.readBytes(inputStream, inputStream.read()); } else {
diff --git a/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF index 82e6a04..f54350d 100644 --- a/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-Name: %Bundle-Name Automatic-Module-Name: org.eclipse.jgit.http.apache Bundle-SymbolicName: org.eclipse.jgit.http.apache -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-11 Bundle-Localization: OSGI-INF/l10n/plugin Bundle-Vendor: %Bundle-Vendor @@ -26,11 +26,11 @@ org.apache.http.impl.conn;version="[4.4.0,5.0.0)", org.apache.http.params;version="[4.3.0,5.0.0)", org.apache.http.ssl;version="[4.3.0,5.0.0)", - org.eclipse.jgit.annotations;version="[6.9.1,6.10.0)", - org.eclipse.jgit.nls;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport.http;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util;version="[6.9.1,6.10.0)" -Export-Package: org.eclipse.jgit.transport.http.apache;version="6.9.1"; + org.eclipse.jgit.annotations;version="[6.10.2,6.11.0)", + org.eclipse.jgit.nls;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport.http;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util;version="[6.10.2,6.11.0)" +Export-Package: org.eclipse.jgit.transport.http.apache;version="6.10.2"; uses:="org.apache.http.client, org.eclipse.jgit.transport.http, org.apache.http.entity,
diff --git a/org.eclipse.jgit.http.apache/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.http.apache/META-INF/SOURCE-MANIFEST.MF index db19ed1..00bf64e 100644 --- a/org.eclipse.jgit.http.apache/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.http.apache/META-INF/SOURCE-MANIFEST.MF
@@ -3,5 +3,5 @@ Bundle-Name: org.eclipse.jgit.http.apache - Sources Bundle-SymbolicName: org.eclipse.jgit.http.apache.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 6.9.1.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.http.apache;version="6.9.1.qualifier";roots="." +Bundle-Version: 6.10.2.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.http.apache;version="6.10.2.qualifier";roots="."
diff --git a/org.eclipse.jgit.http.apache/pom.xml b/org.eclipse.jgit.http.apache/pom.xml index 0353fdf..eb714a3 100644 --- a/org.eclipse.jgit.http.apache/pom.xml +++ b/org.eclipse.jgit.http.apache/pom.xml
@@ -15,7 +15,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.http.apache</artifactId>
diff --git a/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java index 6d806de..0cb6fe1 100644 --- a/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java +++ b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java
@@ -25,10 +25,10 @@ import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -300,7 +300,7 @@ public Map<String, List<String>> getHeaderFields() { for (Header hdr : resp.getAllHeaders()) { List<String> list = ret.get(hdr.getName()); if (list == null) { - list = new LinkedList<>(); + list = new ArrayList<>(); ret.put(hdr.getName(), list); } for (HeaderElement hdrElem : hdr.getElements()) {
diff --git a/org.eclipse.jgit.http.server/BUILD b/org.eclipse.jgit.http.server/BUILD index f8aa44d..a0dae48 100644 --- a/org.eclipse.jgit.http.server/BUILD +++ b/org.eclipse.jgit.http.server/BUILD
@@ -2,11 +2,16 @@ package(default_visibility = ["//visibility:public"]) +filegroup( + name = "jgit-servlet-resources", + srcs = glob(["resources/**"]), +) + java_library( name = "jgit-servlet", srcs = glob(["src/**/*.java"]), resource_strip_prefix = "org.eclipse.jgit.http.server/resources", - resources = glob(["resources/**"]), + resources = [":jgit-servlet-resources"], deps = [ "//lib:servlet-api", # We want these deps to be provided_deps
diff --git a/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF index fb8e105..7192432 100644 --- a/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF
@@ -3,13 +3,13 @@ Bundle-Name: %Bundle-Name Automatic-Module-Name: org.eclipse.jgit.http.server Bundle-SymbolicName: org.eclipse.jgit.http.server -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-Localization: OSGI-INF/l10n/plugin Bundle-Vendor: %Bundle-Vendor -Export-Package: org.eclipse.jgit.http.server;version="6.9.1", - org.eclipse.jgit.http.server.glue;version="6.9.1"; +Export-Package: org.eclipse.jgit.http.server;version="6.10.2", + org.eclipse.jgit.http.server.glue;version="6.10.2"; uses:="javax.servlet,javax.servlet.http", - org.eclipse.jgit.http.server.resolver;version="6.9.1"; + org.eclipse.jgit.http.server.resolver;version="6.10.2"; uses:="org.eclipse.jgit.transport.resolver, org.eclipse.jgit.lib, org.eclipse.jgit.transport, @@ -18,14 +18,14 @@ Bundle-RequiredExecutionEnvironment: JavaSE-11 Import-Package: javax.servlet;version="[2.5.0,5.0.0)", javax.servlet.http;version="[2.5.0,5.0.0)", - org.eclipse.jgit.annotations;version="[6.9.1,6.10.0)", - org.eclipse.jgit.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.dfs;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.file;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.transport.parser;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lib;version="[6.9.1,6.10.0)", - org.eclipse.jgit.nls;version="[6.9.1,6.10.0)", - org.eclipse.jgit.revwalk;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport.resolver;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util;version="[6.9.1,6.10.0)" + org.eclipse.jgit.annotations;version="[6.10.2,6.11.0)", + org.eclipse.jgit.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.dfs;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.file;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.transport.parser;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lib;version="[6.10.2,6.11.0)", + org.eclipse.jgit.nls;version="[6.10.2,6.11.0)", + org.eclipse.jgit.revwalk;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport.resolver;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util;version="[6.10.2,6.11.0)"
diff --git a/org.eclipse.jgit.http.server/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.http.server/META-INF/SOURCE-MANIFEST.MF index b765631..2630ad2 100644 --- a/org.eclipse.jgit.http.server/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.http.server/META-INF/SOURCE-MANIFEST.MF
@@ -3,5 +3,5 @@ Bundle-Name: org.eclipse.jgit.http.server - Sources Bundle-SymbolicName: org.eclipse.jgit.http.server.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 6.9.1.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.http.server;version="6.9.1.qualifier";roots="." +Bundle-Version: 6.10.2.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.http.server;version="6.10.2.qualifier";roots="."
diff --git a/org.eclipse.jgit.http.server/pom.xml b/org.eclipse.jgit.http.server/pom.xml index 3637292..5be0847 100644 --- a/org.eclipse.jgit.http.server/pom.xml +++ b/org.eclipse.jgit.http.server/pom.xml
@@ -19,7 +19,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.http.server</artifactId>
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java index 2f3eee4..703c0be 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java
@@ -12,7 +12,7 @@ import java.io.File; import java.text.MessageFormat; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import javax.servlet.Filter; @@ -65,9 +65,9 @@ public class GitFilter extends MetaFilter { private ReceivePackErrorHandler receivePackErrorHandler; - private final List<Filter> uploadPackFilters = new LinkedList<>(); + private final List<Filter> uploadPackFilters = new ArrayList<>(); - private final List<Filter> receivePackFilters = new LinkedList<>(); + private final List<Filter> receivePackFilters = new ArrayList<>(); /** * New servlet that will load its base directory from {@code web.xml}.
diff --git a/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF index cc84aac..23d4838 100644 --- a/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-Name: %Bundle-Name Automatic-Module-Name: org.eclipse.jgit.http.test Bundle-SymbolicName: org.eclipse.jgit.http.test -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-Vendor: %Bundle-Vendor Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-11 @@ -28,26 +28,26 @@ org.eclipse.jetty.util.log;version="[10.0.0,11.0.0)", org.eclipse.jetty.util.security;version="[10.0.0,11.0.0)", org.eclipse.jetty.util.thread;version="[10.0.0,11.0.0)", - org.eclipse.jgit.api;version="[6.9.1,6.10.0)", - org.eclipse.jgit.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.http.server;version="[6.9.1,6.10.0)", - org.eclipse.jgit.http.server.glue;version="[6.9.1,6.10.0)", - org.eclipse.jgit.http.server.resolver;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.dfs;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.file;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.reftable;version="[6.9.1,6.10.0)", - org.eclipse.jgit.junit;version="[6.9.1,6.10.0)", - org.eclipse.jgit.junit.http;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lib;version="[6.9.1,6.10.0)", - org.eclipse.jgit.nls;version="[6.9.1,6.10.0)", - org.eclipse.jgit.revwalk;version="[6.9.1,6.10.0)", - org.eclipse.jgit.storage.file;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport.http;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport.http.apache;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport.resolver;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util;version="[6.9.1,6.10.0)", + org.eclipse.jgit.api;version="[6.10.2,6.11.0)", + org.eclipse.jgit.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.http.server;version="[6.10.2,6.11.0)", + org.eclipse.jgit.http.server.glue;version="[6.10.2,6.11.0)", + org.eclipse.jgit.http.server.resolver;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.dfs;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.file;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.reftable;version="[6.10.2,6.11.0)", + org.eclipse.jgit.junit;version="[6.10.2,6.11.0)", + org.eclipse.jgit.junit.http;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lib;version="[6.10.2,6.11.0)", + org.eclipse.jgit.nls;version="[6.10.2,6.11.0)", + org.eclipse.jgit.revwalk;version="[6.10.2,6.11.0)", + org.eclipse.jgit.storage.file;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport.http;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport.http.apache;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport.resolver;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util;version="[6.10.2,6.11.0)", org.junit;version="[4.13,5.0.0)", org.junit.rules;version="[4.13,5.0.0)", org.junit.runner;version="[4.13,5.0.0)",
diff --git a/org.eclipse.jgit.http.test/pom.xml b/org.eclipse.jgit.http.test/pom.xml index eba5578..c8f8e1a 100644 --- a/org.eclipse.jgit.http.test/pom.xml +++ b/org.eclipse.jgit.http.test/pom.xml
@@ -18,7 +18,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.http.test</artifactId>
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/FileResolverTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/FileResolverTest.java index 8d25c2e..34c871a 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/FileResolverTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/FileResolverTest.java
@@ -88,7 +88,7 @@ public void testExportOk() throws IOException { try { resolver.open(null, name).close(); } catch (ServiceNotEnabledException e) { - fail("did not honor export-all flag"); + throw new AssertionError("did not honor export-all flag", e); } FileUtils.createNewFile(export); @@ -99,7 +99,7 @@ public void testExportOk() throws IOException { try { resolver.open(null, name).close(); } catch (ServiceNotEnabledException e) { - fail("did not honor git-daemon-export-ok"); + throw new AssertionError("did not honor git-daemon-export-ok", e); } }
diff --git a/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF b/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF index 533f170..df47b67 100644 --- a/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-Name: %Bundle-Name Automatic-Module-Name: org.eclipse.jgit.junit.http Bundle-SymbolicName: org.eclipse.jgit.junit.http -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-Localization: OSGI-INF/l10n/plugin Bundle-Vendor: %Bundle-Vendor Bundle-ActivationPolicy: lazy @@ -21,17 +21,17 @@ org.eclipse.jetty.util.log;version="[10.0.0,11.0.0)", org.eclipse.jetty.util.security;version="[10.0.0,11.0.0)", org.eclipse.jetty.util.ssl;version="[10.0.0,11.0.0)", - org.eclipse.jgit.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.http.server;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.file;version="[6.9.1,6.10.0)", - org.eclipse.jgit.junit;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lib;version="[6.9.1,6.10.0)", - org.eclipse.jgit.revwalk;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport.resolver;version="[6.9.1,6.10.0)", + org.eclipse.jgit.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.http.server;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.file;version="[6.10.2,6.11.0)", + org.eclipse.jgit.junit;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lib;version="[6.10.2,6.11.0)", + org.eclipse.jgit.revwalk;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport.resolver;version="[6.10.2,6.11.0)", org.junit;version="[4.13,5.0.0)", org.slf4j.helpers;version="[1.7.0,3.0.0)" -Export-Package: org.eclipse.jgit.junit.http;version="6.9.1"; +Export-Package: org.eclipse.jgit.junit.http;version="6.10.2"; uses:="org.eclipse.jgit.transport, org.eclipse.jgit.junit, javax.servlet.http,
diff --git a/org.eclipse.jgit.junit.http/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.junit.http/META-INF/SOURCE-MANIFEST.MF index 2da4567..1799d14 100644 --- a/org.eclipse.jgit.junit.http/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.junit.http/META-INF/SOURCE-MANIFEST.MF
@@ -3,5 +3,5 @@ Bundle-Name: org.eclipse.jgit.junit.http - Sources Bundle-SymbolicName: org.eclipse.jgit.junit.http.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 6.9.1.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.junit.http;version="6.9.1.qualifier";roots="." +Bundle-Version: 6.10.2.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.junit.http;version="6.10.2.qualifier";roots="."
diff --git a/org.eclipse.jgit.junit.http/pom.xml b/org.eclipse.jgit.junit.http/pom.xml index e6206e2..2bc53ea 100644 --- a/org.eclipse.jgit.junit.http/pom.xml +++ b/org.eclipse.jgit.junit.http/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.junit.http</artifactId>
diff --git a/org.eclipse.jgit.junit.ssh/META-INF/MANIFEST.MF b/org.eclipse.jgit.junit.ssh/META-INF/MANIFEST.MF index e7f8972..d634e94 100644 --- a/org.eclipse.jgit.junit.ssh/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.junit.ssh/META-INF/MANIFEST.MF
@@ -3,46 +3,46 @@ Bundle-Name: %Bundle-Name Automatic-Module-Name: org.eclipse.jgit.junit.ssh Bundle-SymbolicName: org.eclipse.jgit.junit.ssh -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-Localization: OSGI-INF/l10n/plugin Bundle-Vendor: %Bundle-Vendor Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-11 -Import-Package: org.apache.sshd.common;version="[2.12.0,2.13.0)", - org.apache.sshd.common.config.keys;version="[2.12.0,2.13.0)", - org.apache.sshd.common.file.virtualfs;version="[2.12.0,2.13.0)", - org.apache.sshd.common.helpers;version="[2.12.0,2.13.0)", - org.apache.sshd.common.io;version="[2.12.0,2.13.0)", - org.apache.sshd.common.kex;version="[2.12.0,2.13.0)", - org.apache.sshd.common.keyprovider;version="[2.12.0,2.13.0)", - org.apache.sshd.common.session;version="[2.12.0,2.13.0)", - org.apache.sshd.common.signature;version="[2.12.0,2.13.0)", - org.apache.sshd.common.util.buffer;version="[2.12.0,2.13.0)", - org.apache.sshd.common.util.logging;version="[2.12.0,2.13.0)", - org.apache.sshd.common.util.security;version="[2.12.0,2.13.0)", - org.apache.sshd.common.util.threads;version="[2.12.0,2.13.0)", - org.apache.sshd.core;version="[2.12.0,2.13.0)", - org.apache.sshd.server;version="[2.12.0,2.13.0)", - org.apache.sshd.server.auth;version="[2.12.0,2.13.0)", - org.apache.sshd.server.auth.gss;version="[2.12.0,2.13.0)", - org.apache.sshd.server.auth.keyboard;version="[2.12.0,2.13.0)", - org.apache.sshd.server.auth.password;version="[2.12.0,2.13.0)", - org.apache.sshd.server.command;version="[2.12.0,2.13.0)", - org.apache.sshd.server.session;version="[2.12.0,2.13.0)", - org.apache.sshd.server.shell;version="[2.12.0,2.13.0)", - org.apache.sshd.server.subsystem;version="[2.12.0,2.13.0)", - org.apache.sshd.sftp;version="[2.12.0,2.13.0)", - org.apache.sshd.sftp.server;version="[2.12.0,2.13.0)", - org.eclipse.jgit.annotations;version="[6.9.1,6.10.0)", - org.eclipse.jgit.api;version="[6.9.1,6.10.0)", - org.eclipse.jgit.api.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.junit;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lib;version="[6.9.1,6.10.0)", - org.eclipse.jgit.revwalk;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util;version="[6.9.1,6.10.0)", +Import-Package: org.apache.sshd.common;version="[2.14.0,2.15.0)", + org.apache.sshd.common.config.keys;version="[2.14.0,2.15.0)", + org.apache.sshd.common.file.virtualfs;version="[2.14.0,2.15.0)", + org.apache.sshd.common.helpers;version="[2.14.0,2.15.0)", + org.apache.sshd.common.io;version="[2.14.0,2.15.0)", + org.apache.sshd.common.kex;version="[2.14.0,2.15.0)", + org.apache.sshd.common.keyprovider;version="[2.14.0,2.15.0)", + org.apache.sshd.common.session;version="[2.14.0,2.15.0)", + org.apache.sshd.common.signature;version="[2.14.0,2.15.0)", + org.apache.sshd.common.util.buffer;version="[2.14.0,2.15.0)", + org.apache.sshd.common.util.logging;version="[2.14.0,2.15.0)", + org.apache.sshd.common.util.security;version="[2.14.0,2.15.0)", + org.apache.sshd.common.util.threads;version="[2.14.0,2.15.0)", + org.apache.sshd.core;version="[2.14.0,2.15.0)", + org.apache.sshd.server;version="[2.14.0,2.15.0)", + org.apache.sshd.server.auth;version="[2.14.0,2.15.0)", + org.apache.sshd.server.auth.gss;version="[2.14.0,2.15.0)", + org.apache.sshd.server.auth.keyboard;version="[2.14.0,2.15.0)", + org.apache.sshd.server.auth.password;version="[2.14.0,2.15.0)", + org.apache.sshd.server.command;version="[2.14.0,2.15.0)", + org.apache.sshd.server.session;version="[2.14.0,2.15.0)", + org.apache.sshd.server.shell;version="[2.14.0,2.15.0)", + org.apache.sshd.server.subsystem;version="[2.14.0,2.15.0)", + org.apache.sshd.sftp;version="[2.14.0,2.15.0)", + org.apache.sshd.sftp.server;version="[2.14.0,2.15.0)", + org.eclipse.jgit.annotations;version="[6.10.2,6.11.0)", + org.eclipse.jgit.api;version="[6.10.2,6.11.0)", + org.eclipse.jgit.api.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.junit;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lib;version="[6.10.2,6.11.0)", + org.eclipse.jgit.revwalk;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util;version="[6.10.2,6.11.0)", org.junit;version="[4.13,5.0.0)", org.junit.experimental.theories;version="[4.13,5.0.0)", org.slf4j;version="[1.7.0,3.0.0)" -Export-Package: org.eclipse.jgit.junit.ssh;version="6.9.1" +Export-Package: org.eclipse.jgit.junit.ssh;version="6.10.2"
diff --git a/org.eclipse.jgit.junit.ssh/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.junit.ssh/META-INF/SOURCE-MANIFEST.MF index 24e31eb..9e57cf4 100644 --- a/org.eclipse.jgit.junit.ssh/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.junit.ssh/META-INF/SOURCE-MANIFEST.MF
@@ -3,5 +3,5 @@ Bundle-Name: org.eclipse.jgit.junit.ssh - Sources Bundle-SymbolicName: org.eclipse.jgit.junit.ssh.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 6.9.1.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.junit.ssh;version="6.9.1.qualifier";roots="." +Bundle-Version: 6.10.2.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.junit.ssh;version="6.10.2.qualifier";roots="."
diff --git a/org.eclipse.jgit.junit.ssh/pom.xml b/org.eclipse.jgit.junit.ssh/pom.xml index 7cf78c3..27631b2 100644 --- a/org.eclipse.jgit.junit.ssh/pom.xml +++ b/org.eclipse.jgit.junit.ssh/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.junit.ssh</artifactId>
diff --git a/org.eclipse.jgit.junit.ssh/src/org/eclipse/jgit/junit/ssh/SshTestGitServer.java b/org.eclipse.jgit.junit.ssh/src/org/eclipse/jgit/junit/ssh/SshTestGitServer.java index 1138be8..f5627e0 100644 --- a/org.eclipse.jgit.junit.ssh/src/org/eclipse/jgit/junit/ssh/SshTestGitServer.java +++ b/org.eclipse.jgit.junit.ssh/src/org/eclipse/jgit/junit/ssh/SshTestGitServer.java
@@ -323,7 +323,7 @@ protected List<SubsystemFactory> configureSubsystems() { server.setFileSystemFactory(new VirtualFileSystemFactory(repository .getDirectory().getParentFile().getAbsoluteFile().toPath())); return Collections - .singletonList((new SftpSubsystemFactory.Builder()).build()); + .singletonList(new SftpSubsystemFactory.Builder().build()); } /**
diff --git a/org.eclipse.jgit.junit/META-INF/MANIFEST.MF b/org.eclipse.jgit.junit/META-INF/MANIFEST.MF index bd87460..498d1b0 100644 --- a/org.eclipse.jgit.junit/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.junit/META-INF/MANIFEST.MF
@@ -3,36 +3,36 @@ Bundle-Name: %Bundle-Name Automatic-Module-Name: org.eclipse.jgit.junit Bundle-SymbolicName: org.eclipse.jgit.junit -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-Localization: OSGI-INF/l10n/plugin Bundle-Vendor: %Bundle-Vendor Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-11 -Import-Package: org.eclipse.jgit.annotations;version="[6.9.1,6.10.0)", - org.eclipse.jgit.api;version="[6.9.1,6.10.0)", - org.eclipse.jgit.api.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.dircache;version="[6.9.1,6.10.0)", - org.eclipse.jgit.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.file;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.pack;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.util;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lib;version="[6.9.1,6.10.0)", - org.eclipse.jgit.merge;version="[6.9.1,6.10.0)", - org.eclipse.jgit.revwalk;version="[6.9.1,6.10.0)", - org.eclipse.jgit.storage.file;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport;version="6.9.1", - org.eclipse.jgit.treewalk;version="[6.9.1,6.10.0)", - org.eclipse.jgit.treewalk.filter;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util.io;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util.time;version="[6.9.1,6.10.0)", +Import-Package: org.eclipse.jgit.annotations;version="[6.10.2,6.11.0)", + org.eclipse.jgit.api;version="[6.10.2,6.11.0)", + org.eclipse.jgit.api.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.dircache;version="[6.10.2,6.11.0)", + org.eclipse.jgit.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.file;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.pack;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.util;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lib;version="[6.10.2,6.11.0)", + org.eclipse.jgit.merge;version="[6.10.2,6.11.0)", + org.eclipse.jgit.revwalk;version="[6.10.2,6.11.0)", + org.eclipse.jgit.storage.file;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport;version="6.10.2", + org.eclipse.jgit.treewalk;version="[6.10.2,6.11.0)", + org.eclipse.jgit.treewalk.filter;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util.io;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util.time;version="[6.10.2,6.11.0)", org.junit;version="[4.13,5.0.0)", org.junit.rules;version="[4.13,5.0.0)", org.junit.runner;version="[4.13,5.0.0)", org.junit.runners;version="[4.13,5.0.0)", org.junit.runners.model;version="[4.13,5.0.0)", org.slf4j;version="[1.7.0,3.0.0)" -Export-Package: org.eclipse.jgit.junit;version="6.9.1"; +Export-Package: org.eclipse.jgit.junit;version="6.10.2"; uses:="org.eclipse.jgit.dircache, org.eclipse.jgit.lib, org.eclipse.jgit.revwalk, @@ -45,4 +45,4 @@ org.junit.runners.model, org.junit.runner, org.eclipse.jgit.util.time", - org.eclipse.jgit.junit.time;version="6.9.1";uses:="org.eclipse.jgit.util.time" + org.eclipse.jgit.junit.time;version="6.10.2";uses:="org.eclipse.jgit.util.time"
diff --git a/org.eclipse.jgit.junit/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.junit/META-INF/SOURCE-MANIFEST.MF index 52fc544..95e47f3 100644 --- a/org.eclipse.jgit.junit/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.junit/META-INF/SOURCE-MANIFEST.MF
@@ -3,5 +3,5 @@ Bundle-Name: org.eclipse.jgit.junit - Sources Bundle-SymbolicName: org.eclipse.jgit.junit.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 6.9.1.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.junit;version="6.9.1.qualifier";roots="." +Bundle-Version: 6.10.2.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.junit;version="6.10.2.qualifier";roots="."
diff --git a/org.eclipse.jgit.junit/pom.xml b/org.eclipse.jgit.junit/pom.xml index 1638238..3db8b20 100644 --- a/org.eclipse.jgit.junit/pom.xml +++ b/org.eclipse.jgit.junit/pom.xml
@@ -19,7 +19,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.junit</artifactId>
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java index a2e0a57..c6cdfaf 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
@@ -30,6 +30,7 @@ import java.util.Set; import java.util.TimeZone; +import org.eclipse.jgit.annotations.Nullable; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.dircache.DirCache; import org.eclipse.jgit.dircache.DirCacheBuilder; @@ -1019,7 +1020,8 @@ public void close() { private static void prunePacked(ObjectDirectory odb) throws IOException { for (Pack p : odb.getPacks()) { for (MutableEntry e : p) - FileUtils.delete(odb.fileFor(e.toObjectId())); + FileUtils.delete(odb.fileFor(e.toObjectId()), + FileUtils.SKIP_MISSING); } } @@ -1144,15 +1146,18 @@ public class CommitBuilder { } /** - * set parent commit + * Set parent commit * * @param p - * parent commit + * parent commit, can be {@code null} * @return this commit builder * @throws Exception * if an error occurred */ - public CommitBuilder parent(RevCommit p) throws Exception { + public CommitBuilder parent(@Nullable RevCommit p) throws Exception { + if (p == null) { + return this; + } if (parents.isEmpty()) { DirCacheBuilder b = tree.builder(); parseBody(p);
diff --git a/org.eclipse.jgit.lfs.server.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.lfs.server.test/META-INF/MANIFEST.MF index 266d9bb..2624f1b 100644 --- a/org.eclipse.jgit.lfs.server.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.lfs.server.test/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-Name: %Bundle-Name Automatic-Module-Name: org.eclipse.jgit.lfs.server.test Bundle-SymbolicName: org.eclipse.jgit.lfs.server.test -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-Vendor: %Bundle-Vendor Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-11 @@ -26,24 +26,24 @@ org.eclipse.jetty.util.log;version="[10.0.0,11.0.0)", org.eclipse.jetty.util.security;version="[10.0.0,11.0.0)", org.eclipse.jetty.util.thread;version="[10.0.0,11.0.0)", - org.eclipse.jgit.api;version="[6.9.1,6.10.0)", - org.eclipse.jgit.api.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.file;version="[6.9.1,6.10.0)", - org.eclipse.jgit.junit;version="[6.9.1,6.10.0)", - org.eclipse.jgit.junit.http;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lfs;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lfs.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lfs.lib;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lfs.server;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lfs.server.fs;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lfs.test;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lib;version="[6.9.1,6.10.0)", - org.eclipse.jgit.revwalk;version="[6.9.1,6.10.0)", - org.eclipse.jgit.storage.file;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport;version="[6.9.1,6.10.0)", - org.eclipse.jgit.treewalk;version="[6.9.1,6.10.0)", - org.eclipse.jgit.treewalk.filter;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util;version="[6.9.1,6.10.0)", + org.eclipse.jgit.api;version="[6.10.2,6.11.0)", + org.eclipse.jgit.api.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.file;version="[6.10.2,6.11.0)", + org.eclipse.jgit.junit;version="[6.10.2,6.11.0)", + org.eclipse.jgit.junit.http;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lfs;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lfs.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lfs.lib;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lfs.server;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lfs.server.fs;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lfs.test;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lib;version="[6.10.2,6.11.0)", + org.eclipse.jgit.revwalk;version="[6.10.2,6.11.0)", + org.eclipse.jgit.storage.file;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport;version="[6.10.2,6.11.0)", + org.eclipse.jgit.treewalk;version="[6.10.2,6.11.0)", + org.eclipse.jgit.treewalk.filter;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util;version="[6.10.2,6.11.0)", org.hamcrest.core;version="[1.1.0,3.0.0)", org.junit;version="[4.13,5.0.0)", org.junit.rules;version="[4.13,5.0.0)",
diff --git a/org.eclipse.jgit.lfs.server.test/pom.xml b/org.eclipse.jgit.lfs.server.test/pom.xml index 53ee569..bb33336 100644 --- a/org.eclipse.jgit.lfs.server.test/pom.xml +++ b/org.eclipse.jgit.lfs.server.test/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.lfs.server.test</artifactId>
diff --git a/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF b/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF index f3a5028..322951d 100644 --- a/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF
@@ -3,19 +3,19 @@ Bundle-Name: %Bundle-Name Automatic-Module-Name: org.eclipse.jgit.lfs.server Bundle-SymbolicName: org.eclipse.jgit.lfs.server -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-Localization: OSGI-INF/l10n/plugin Bundle-Vendor: %Bundle-Vendor -Export-Package: org.eclipse.jgit.lfs.server;version="6.9.1"; +Export-Package: org.eclipse.jgit.lfs.server;version="6.10.2"; uses:="javax.servlet.http, org.eclipse.jgit.lfs.lib", - org.eclipse.jgit.lfs.server.fs;version="6.9.1"; + org.eclipse.jgit.lfs.server.fs;version="6.10.2"; uses:="javax.servlet, javax.servlet.http, org.eclipse.jgit.lfs.server, org.eclipse.jgit.lfs.lib", - org.eclipse.jgit.lfs.server.internal;version="6.9.1";x-internal:=true, - org.eclipse.jgit.lfs.server.s3;version="6.9.1"; + org.eclipse.jgit.lfs.server.internal;version="6.10.2";x-internal:=true, + org.eclipse.jgit.lfs.server.s3;version="6.10.2"; uses:="org.eclipse.jgit.lfs.server, org.eclipse.jgit.lfs.lib" Bundle-RequiredExecutionEnvironment: JavaSE-11 @@ -24,15 +24,15 @@ javax.servlet.annotation;version="[3.1.0,5.0.0)", javax.servlet.http;version="[3.1.0,5.0.0)", org.apache.http;version="[4.3.0,5.0.0)", - org.eclipse.jgit.annotations;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.file;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lfs.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lfs.internal;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lfs.lib;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lib;version="[6.9.1,6.10.0)", - org.eclipse.jgit.nls;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport.http;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport.http.apache;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util;version="[6.9.1,6.10.0)", + org.eclipse.jgit.annotations;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.file;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lfs.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lfs.internal;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lfs.lib;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lib;version="[6.10.2,6.11.0)", + org.eclipse.jgit.nls;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport.http;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport.http.apache;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util;version="[6.10.2,6.11.0)", org.slf4j;version="[1.7.0,3.0.0)"
diff --git a/org.eclipse.jgit.lfs.server/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.lfs.server/META-INF/SOURCE-MANIFEST.MF index 4a869dd..5965f1c 100644 --- a/org.eclipse.jgit.lfs.server/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.lfs.server/META-INF/SOURCE-MANIFEST.MF
@@ -3,5 +3,5 @@ Bundle-Name: org.eclipse.jgit.lfs.server - Sources Bundle-SymbolicName: org.eclipse.jgit.lfs.server.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 6.9.1.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.lfs.server;version="6.9.1.qualifier";roots="." +Bundle-Version: 6.10.2.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.lfs.server;version="6.10.2.qualifier";roots="."
diff --git a/org.eclipse.jgit.lfs.server/pom.xml b/org.eclipse.jgit.lfs.server/pom.xml index b1eca71..8da0d6b 100644 --- a/org.eclipse.jgit.lfs.server/pom.xml +++ b/org.eclipse.jgit.lfs.server/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.lfs.server</artifactId>
diff --git a/org.eclipse.jgit.lfs.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.lfs.test/META-INF/MANIFEST.MF index 4ea3ccb..0b597d9 100644 --- a/org.eclipse.jgit.lfs.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.lfs.test/META-INF/MANIFEST.MF
@@ -3,27 +3,28 @@ Bundle-Name: %Bundle-Name Automatic-Module-Name: org.eclipse.jgit.lfs.test Bundle-SymbolicName: org.eclipse.jgit.lfs.test -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-Vendor: %Bundle-Vendor Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-11 -Import-Package: org.eclipse.jgit.api;version="[6.9.1,6.10.0)", - org.eclipse.jgit.attributes;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.dfs;version="[6.9.1,6.10.0)", - org.eclipse.jgit.junit;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lfs;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lfs.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lfs.internal;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lfs.lib;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lib;version="[6.9.1,6.10.0)", - org.eclipse.jgit.revwalk;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport.http;version="[6.9.1,6.10.0)", - org.eclipse.jgit.treewalk;version="[6.9.1,6.10.0)", - org.eclipse.jgit.treewalk.filter;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util;version="[6.9.1,6.10.0)", +Import-Package: org.eclipse.jgit.api;version="[6.10.2,6.11.0)", + org.eclipse.jgit.attributes;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.dfs;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.file;version="[6.10.2,6.11.0)", + org.eclipse.jgit.junit;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lfs;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lfs.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lfs.internal;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lfs.lib;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lib;version="[6.10.2,6.11.0)", + org.eclipse.jgit.revwalk;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport.http;version="[6.10.2,6.11.0)", + org.eclipse.jgit.treewalk;version="[6.10.2,6.11.0)", + org.eclipse.jgit.treewalk.filter;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util;version="[6.10.2,6.11.0)", org.hamcrest.core;version="[1.1.0,3.0.0)", org.junit;version="[4.13,5.0.0)", org.junit.runner;version="[4.13,5.0.0)", org.junit.runners;version="[4.13,5.0.0)" -Export-Package: org.eclipse.jgit.lfs.test;version="6.9.1";x-friends:="org.eclipse.jgit.lfs.server.test" +Export-Package: org.eclipse.jgit.lfs.test;version="6.10.2";x-friends:="org.eclipse.jgit.lfs.server.test"
diff --git a/org.eclipse.jgit.lfs.test/pom.xml b/org.eclipse.jgit.lfs.test/pom.xml index 667335a..e34dd2b 100644 --- a/org.eclipse.jgit.lfs.test/pom.xml +++ b/org.eclipse.jgit.lfs.test/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.lfs.test</artifactId>
diff --git a/org.eclipse.jgit.lfs.test/tst/org/eclipse/jgit/lfs/internal/LfsConnectionFactoryTest.java b/org.eclipse.jgit.lfs.test/tst/org/eclipse/jgit/lfs/internal/LfsConnectionFactoryTest.java index badcb7d..ee8e893 100644 --- a/org.eclipse.jgit.lfs.test/tst/org/eclipse/jgit/lfs/internal/LfsConnectionFactoryTest.java +++ b/org.eclipse.jgit.lfs.test/tst/org/eclipse/jgit/lfs/internal/LfsConnectionFactoryTest.java
@@ -97,7 +97,8 @@ public void lfsUrlFromRemoteUrlWithoutDotGit() throws Exception { public void lfsUrlFromLocalConfig() throws Exception { addRemoteUrl("https://localhost/repo"); - StoredConfig cfg = ((Repository) db).getConfig(); + @SuppressWarnings("restriction") + StoredConfig cfg = db.getConfig(); cfg.setString(ConfigConstants.CONFIG_SECTION_LFS, null, ConfigConstants.CONFIG_KEY_URL, @@ -111,7 +112,8 @@ public void lfsUrlFromLocalConfig() throws Exception { public void lfsUrlFromOriginConfig() throws Exception { addRemoteUrl("https://localhost/repo"); - StoredConfig cfg = ((Repository) db).getConfig(); + @SuppressWarnings("restriction") + StoredConfig cfg = db.getConfig(); cfg.setString(ConfigConstants.CONFIG_SECTION_LFS, org.eclipse.jgit.lib.Constants.DEFAULT_REMOTE_NAME, ConfigConstants.CONFIG_KEY_URL,
diff --git a/org.eclipse.jgit.lfs/META-INF/MANIFEST.MF b/org.eclipse.jgit.lfs/META-INF/MANIFEST.MF index 442a87c..c5f0919 100644 --- a/org.eclipse.jgit.lfs/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.lfs/META-INF/MANIFEST.MF
@@ -3,32 +3,32 @@ Bundle-Name: %Bundle-Name Automatic-Module-Name: org.eclipse.jgit.lfs Bundle-SymbolicName: org.eclipse.jgit.lfs -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-Localization: OSGI-INF/l10n/plugin Bundle-Vendor: %Bundle-Vendor -Export-Package: org.eclipse.jgit.lfs;version="6.9.1", - org.eclipse.jgit.lfs.errors;version="6.9.1", - org.eclipse.jgit.lfs.internal;version="6.9.1";x-friends:="org.eclipse.jgit.lfs.test,org.eclipse.jgit.lfs.server.fs,org.eclipse.jgit.lfs.server", - org.eclipse.jgit.lfs.lib;version="6.9.1" +Export-Package: org.eclipse.jgit.lfs;version="6.10.2", + org.eclipse.jgit.lfs.errors;version="6.10.2", + org.eclipse.jgit.lfs.internal;version="6.10.2";x-friends:="org.eclipse.jgit.lfs.test,org.eclipse.jgit.lfs.server.fs,org.eclipse.jgit.lfs.server", + org.eclipse.jgit.lfs.lib;version="6.10.2" Bundle-RequiredExecutionEnvironment: JavaSE-11 Import-Package: com.google.gson;version="[2.8.2,3.0.0)", com.google.gson.stream;version="[2.8.2,3.0.0)", - org.eclipse.jgit.annotations;version="[6.9.1,6.10.0)";resolution:=optional, - org.eclipse.jgit.api.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.attributes;version="[6.9.1,6.10.0)", - org.eclipse.jgit.diff;version="[6.9.1,6.10.0)", - org.eclipse.jgit.dircache;version="[6.9.1,6.10.0)", - org.eclipse.jgit.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.hooks;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.file;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lib;version="[6.9.1,6.10.0)", - org.eclipse.jgit.nls;version="[6.9.1,6.10.0)", - org.eclipse.jgit.revwalk;version="[6.9.1,6.10.0)", - org.eclipse.jgit.storage.file;version="[6.9.1,6.10.0)", - org.eclipse.jgit.storage.pack;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport.http;version="[6.9.1,6.10.0)", - org.eclipse.jgit.treewalk;version="[6.9.1,6.10.0)", - org.eclipse.jgit.treewalk.filter;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util.io;version="[6.9.1,6.10.0)" + org.eclipse.jgit.annotations;version="[6.10.2,6.11.0)";resolution:=optional, + org.eclipse.jgit.api.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.attributes;version="[6.10.2,6.11.0)", + org.eclipse.jgit.diff;version="[6.10.2,6.11.0)", + org.eclipse.jgit.dircache;version="[6.10.2,6.11.0)", + org.eclipse.jgit.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.hooks;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.file;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lib;version="[6.10.2,6.11.0)", + org.eclipse.jgit.nls;version="[6.10.2,6.11.0)", + org.eclipse.jgit.revwalk;version="[6.10.2,6.11.0)", + org.eclipse.jgit.storage.file;version="[6.10.2,6.11.0)", + org.eclipse.jgit.storage.pack;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport.http;version="[6.10.2,6.11.0)", + org.eclipse.jgit.treewalk;version="[6.10.2,6.11.0)", + org.eclipse.jgit.treewalk.filter;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util.io;version="[6.10.2,6.11.0)"
diff --git a/org.eclipse.jgit.lfs/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.lfs/META-INF/SOURCE-MANIFEST.MF index ad93a57..6ca664d 100644 --- a/org.eclipse.jgit.lfs/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.lfs/META-INF/SOURCE-MANIFEST.MF
@@ -3,5 +3,5 @@ Bundle-Name: org.eclipse.jgit.lfs - Sources Bundle-SymbolicName: org.eclipse.jgit.lfs.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 6.9.1.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.lfs;version="6.9.1.qualifier";roots="." +Bundle-Version: 6.10.2.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.lfs;version="6.10.2.qualifier";roots="."
diff --git a/org.eclipse.jgit.lfs/pom.xml b/org.eclipse.jgit.lfs/pom.xml index 1dd81e0..b85a0da 100644 --- a/org.eclipse.jgit.lfs/pom.xml +++ b/org.eclipse.jgit.lfs/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.lfs</artifactId>
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConnectionFactory.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConnectionFactory.java index d7d8d63..1a4e85d 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConnectionFactory.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConnectionFactory.java
@@ -9,11 +9,11 @@ */ package org.eclipse.jgit.lfs.internal; +import static org.eclipse.jgit.lib.Constants.DEFAULT_REMOTE_NAME; import static org.eclipse.jgit.util.HttpSupport.ENCODING_GZIP; import static org.eclipse.jgit.util.HttpSupport.HDR_ACCEPT; import static org.eclipse.jgit.util.HttpSupport.HDR_ACCEPT_ENCODING; import static org.eclipse.jgit.util.HttpSupport.HDR_CONTENT_TYPE; -import static org.eclipse.jgit.lib.Constants.DEFAULT_REMOTE_NAME; import java.io.IOException; import java.net.ProxySelector; @@ -22,7 +22,7 @@ import java.time.LocalDateTime; import java.time.ZoneOffset; import java.time.format.DateTimeFormatter; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.Map; import java.util.TreeMap; @@ -266,7 +266,7 @@ public static Protocol.Request toRequest(String operation, Protocol.Request req = new Protocol.Request(); req.operation = operation; if (resources != null) { - req.objects = new LinkedList<>(); + req.objects = new ArrayList<>(); for (LfsPointer res : resources) { Protocol.ObjectSpec o = new Protocol.ObjectSpec(); o.oid = res.getOid().getName();
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/feature.xml index 53a6d97..0c2419c 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/feature.xml
@@ -2,7 +2,7 @@ <feature id="org.eclipse.jgit" label="%featureName" - version="6.9.1.qualifier" + version="6.10.2.qualifier" provider-name="%providerName"> <description url="http://www.eclipse.org/jgit/">
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml index a8df8d3..d20bb38 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>jgit.tycho.parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <groupId>org.eclipse.jgit.feature</groupId>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.gpg.bc.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.gpg.bc.feature/feature.xml index e12bace..51c8dcc 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.gpg.bc.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.gpg.bc.feature/feature.xml
@@ -2,7 +2,7 @@ <feature id="org.eclipse.jgit.gpg.bc" label="%featureName" - version="6.9.1.qualifier" + version="6.10.2.qualifier" provider-name="%providerName"> <description url="http://www.eclipse.org/jgit/"> @@ -23,7 +23,7 @@ </url> <requires> - <import plugin="org.eclipse.jgit" version="6.9.1" match="equivalent"/> + <import plugin="org.eclipse.jgit" version="6.10.2" match="equivalent"/> </requires> <plugin
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.gpg.bc.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.gpg.bc.feature/pom.xml index 47b6cb2..d610412 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.gpg.bc.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.gpg.bc.feature/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>jgit.tycho.parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <groupId>org.eclipse.jgit.feature</groupId>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/feature.xml index fa9758c..54d5ba3 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/feature.xml
@@ -2,7 +2,7 @@ <feature id="org.eclipse.jgit.http.apache" label="%featureName" - version="6.9.1.qualifier" + version="6.10.2.qualifier" provider-name="%providerName"> <description url="http://www.eclipse.org/jgit/"> @@ -23,7 +23,7 @@ </url> <requires> - <import plugin="org.eclipse.jgit" version="6.9.1" match="equivalent"/> + <import plugin="org.eclipse.jgit" version="6.10.2" match="equivalent"/> </requires> <plugin
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/pom.xml index 7edde81..e5eebd4 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>jgit.tycho.parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <groupId>org.eclipse.jgit.feature</groupId>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.xml index 58e0de9..6f4ed14 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.xml
@@ -2,7 +2,7 @@ <feature id="org.eclipse.jgit.junit" label="%featureName" - version="6.9.1.qualifier" + version="6.10.2.qualifier" provider-name="%providerName"> <description url="http://www.eclipse.org/jgit/"> @@ -24,7 +24,7 @@ <requires> <import plugin="com.jcraft.jsch"/> - <import plugin="org.eclipse.jgit" version="6.9.1" match="equivalent"/> + <import plugin="org.eclipse.jgit" version="6.10.2" match="equivalent"/> </requires> <plugin
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/pom.xml index 46f3650..28d4de2 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>jgit.tycho.parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <groupId>org.eclipse.jgit.feature</groupId>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.lfs.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.lfs.feature/feature.xml index 09d8975..0c290f5 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.lfs.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.lfs.feature/feature.xml
@@ -2,7 +2,7 @@ <feature id="org.eclipse.jgit.lfs" label="%featureName" - version="6.9.1.qualifier" + version="6.10.2.qualifier" provider-name="%providerName"> <description url="http://www.eclipse.org/jgit/"> @@ -23,7 +23,7 @@ </url> <requires> - <import feature="org.eclipse.jgit" version="6.9.1" match="equivalent"/> + <import feature="org.eclipse.jgit" version="6.10.2" match="equivalent"/> </requires> <plugin
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.lfs.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.lfs.feature/pom.xml index 4273207..9e01453 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.lfs.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.lfs.feature/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>jgit.tycho.parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <groupId>org.eclipse.jgit.feature</groupId>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.xml index ad85f8e..233b0e8 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.xml
@@ -2,7 +2,7 @@ <feature id="org.eclipse.jgit.pgm" label="%featureName" - version="6.9.1.qualifier" + version="6.10.2.qualifier" provider-name="%providerName"> <description url="http://www.eclipse.org/jgit/"> @@ -35,9 +35,9 @@ version="0.0.0"/> <requires> - <import feature="org.eclipse.jgit" version="6.9.1" match="equivalent"/> - <import feature="org.eclipse.jgit.lfs" version="6.9.1" match="equivalent"/> - <import feature="org.eclipse.jgit.ssh.apache" version="6.9.1" match="equivalent"/> + <import feature="org.eclipse.jgit" version="6.10.2" match="equivalent"/> + <import feature="org.eclipse.jgit.lfs" version="6.10.2" match="equivalent"/> + <import feature="org.eclipse.jgit.ssh.apache" version="6.10.2" match="equivalent"/> </requires> <plugin
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/pom.xml index 041fac1..5bd5675 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>jgit.tycho.parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <groupId>org.eclipse.jgit.feature</groupId>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/category.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/category.xml index 60349bc..bf24cb8 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/category.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/category.xml
@@ -84,24 +84,45 @@ <bundle id="org.eclipse.jetty.http"> <category name="JGit-dependency-bundles"/> </bundle> + <bundle id="org.eclipse.jetty.http.source"> + <category name="JGit-dependency-bundles"/> + </bundle> <bundle id="org.eclipse.jetty.io"> <category name="JGit-dependency-bundles"/> </bundle> + <bundle id="org.eclipse.jetty.io.source"> + <category name="JGit-dependency-bundles"/> + </bundle> <bundle id="org.eclipse.jetty.security"> <category name="JGit-dependency-bundles"/> </bundle> + <bundle id="org.eclipse.jetty.security.source"> + <category name="JGit-dependency-bundles"/> + </bundle> <bundle id="org.eclipse.jetty.server"> <category name="JGit-dependency-bundles"/> </bundle> + <bundle id="org.eclipse.jetty.server.source"> + <category name="JGit-dependency-bundles"/> + </bundle> <bundle id="org.eclipse.jetty.servlet"> <category name="JGit-dependency-bundles"/> </bundle> + <bundle id="org.eclipse.jetty.servlet.source"> + <category name="JGit-dependency-bundles"/> + </bundle> <bundle id="org.eclipse.jetty.util"> <category name="JGit-dependency-bundles"/> </bundle> + <bundle id="org.eclipse.jetty.util.source"> + <category name="JGit-dependency-bundles"/> + </bundle> <bundle id="org.eclipse.jetty.util.ajax"> <category name="JGit-dependency-bundles"/> </bundle> + <bundle id="org.eclipse.jetty.util.ajax.source"> + <category name="JGit-dependency-bundles"/> + </bundle> <bundle id="net.i2p.crypto.eddsa"> <category name="JGit-dependency-bundles"/> </bundle> @@ -126,10 +147,13 @@ <bundle id="org.apache.commons.commons-compress.source"> <category name="JGit-dependency-bundles"/> </bundle> - <bundle id="org.apache.commons.logging"> + <bundle id="org.apache.commons.lang3"> <category name="JGit-dependency-bundles"/> </bundle> - <bundle id="org.apache.commons.logging.source"> + <bundle id="org.apache.commons.lang3.source"> + <category name="JGit-dependency-bundles"/> + </bundle> + <bundle id="org.apache.commons.logging"> <category name="JGit-dependency-bundles"/> </bundle> <bundle id="org.apache.httpcomponents.httpclient">
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml index 58f47b0..cc55a36 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>jgit.tycho.parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.repository</artifactId>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/feature.xml index c94d25e..c4e512c 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/feature.xml
@@ -2,7 +2,7 @@ <feature id="org.eclipse.jgit.source" label="%featureName" - version="6.9.1.qualifier" + version="6.10.2.qualifier" provider-name="%providerName"> <description url="http://www.eclipse.org/jgit/"> @@ -23,7 +23,7 @@ </url> <requires> - <import feature="org.eclipse.jgit" version="6.9.1" match="equivalent"/> + <import feature="org.eclipse.jgit" version="6.10.2" match="equivalent"/> </requires> <plugin
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/pom.xml index a962942..efbac2d 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>jgit.tycho.parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <groupId>org.eclipse.jgit.feature</groupId> @@ -30,7 +30,7 @@ <dependency> <groupId>org.eclipse.jgit.feature</groupId> <artifactId>org.eclipse.jgit</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </dependency> </dependencies>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.ssh.apache.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.ssh.apache.feature/feature.xml index b1e6e9d..7b5752d 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.ssh.apache.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.ssh.apache.feature/feature.xml
@@ -2,7 +2,7 @@ <feature id="org.eclipse.jgit.ssh.apache" label="%featureName" - version="6.9.1.qualifier" + version="6.10.2.qualifier" provider-name="%providerName"> <description url="http://www.eclipse.org/jgit/"> @@ -23,7 +23,7 @@ </url> <requires> - <import feature="org.eclipse.jgit" version="6.9.1" match="equivalent"/> + <import feature="org.eclipse.jgit" version="6.10.2" match="equivalent"/> </requires> <plugin
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.ssh.apache.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.ssh.apache.feature/pom.xml index 361a31e..e3afca2 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.ssh.apache.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.ssh.apache.feature/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>jgit.tycho.parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <groupId>org.eclipse.jgit.feature</groupId>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.ssh.jsch.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.ssh.jsch.feature/feature.xml index 5856a21..0b3df89 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.ssh.jsch.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.ssh.jsch.feature/feature.xml
@@ -2,7 +2,7 @@ <feature id="org.eclipse.jgit.ssh.jsch" label="%featureName" - version="6.9.1.qualifier" + version="6.10.2.qualifier" provider-name="%providerName"> <description url="http://www.eclipse.org/jgit/"> @@ -23,7 +23,7 @@ </url> <requires> - <import plugin="org.eclipse.jgit" version="6.9.1" match="equivalent"/> + <import plugin="org.eclipse.jgit" version="6.10.2" match="equivalent"/> </requires> <plugin
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.ssh.jsch.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.ssh.jsch.feature/pom.xml index d1ed898..502dec4 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.ssh.jsch.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.ssh.jsch.feature/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>jgit.tycho.parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <groupId>org.eclipse.jgit.feature</groupId>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.21.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.21.tpd deleted file mode 100644 index 5865439..0000000 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.21.tpd +++ /dev/null
@@ -1,8 +0,0 @@ -target "jgit-4.21" with source configurePhase - -include "orbit/orbit-4.30.tpd" -include "maven/dependencies.tpd" - -location "https://download.eclipse.org/releases/2021-12/" { - org.eclipse.osgi lazy -}
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.22.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.22.target deleted file mode 100644 index 7fe3b68..0000000 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.22.target +++ /dev/null
@@ -1,278 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?pde?> -<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.22" sequenceNumber="1708457972"> - <locations> - <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> - <unit id="com.jcraft.jsch" version="0.1.55.v20230916-1400"/> - <unit id="com.jcraft.jsch.source" version="0.1.55.v20230916-1400"/> - <unit id="com.jcraft.jzlib" version="1.1.3.v20230916-1400"/> - <unit id="com.jcraft.jzlib.source" version="1.1.3.v20230916-1400"/> - <unit id="net.i2p.crypto.eddsa" version="0.3.0"/> - <unit id="net.i2p.crypto.eddsa.source" version="0.3.0"/> - <unit id="org.apache.ant" version="1.10.14.v20230922-1200"/> - <unit id="org.apache.ant.source" version="1.10.14.v20230922-1200"/> - <unit id="org.apache.httpcomponents.httpclient" version="4.5.14"/> - <unit id="org.apache.httpcomponents.httpclient.source" version="4.5.14"/> - <unit id="org.apache.httpcomponents.httpcore" version="4.4.16"/> - <unit id="org.apache.httpcomponents.httpcore.source" version="4.4.16"/> - <unit id="org.hamcrest.core" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.core.source" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.library" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.library.source" version="1.3.0.v20230809-1000"/> - <unit id="org.junit" version="4.13.2.v20230809-1000"/> - <unit id="org.junit.source" version="4.13.2.v20230809-1000"/> - <unit id="org.objenesis" version="3.3.0"/> - <unit id="org.objenesis.source" version="3.3.0"/> - <unit id="org.osgi.service.cm" version="1.6.1.202109301733"/> - <unit id="org.osgi.service.cm.source" version="1.6.1.202109301733"/> - <repository location="https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2023-12"/> - </location> - <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> - <unit id="org.eclipse.osgi" version="0.0.0"/> - <repository location="https://download.eclipse.org/releases/2021-12/"/> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="xz"> - <dependencies> - <dependency> - <groupId>org.tukaani</groupId> - <artifactId>xz</artifactId> - <version>1.9</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="slf4j"> - <dependencies> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>1.7.36</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-simple</artifactId> - <version>1.7.36</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="sshd"> - <dependencies> - <dependency> - <groupId>org.apache.sshd</groupId> - <artifactId>sshd-osgi</artifactId> - <version>2.12.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.apache.sshd</groupId> - <artifactId>sshd-sftp</artifactId> - <version>2.12.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="mockito"> - <dependencies> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <version>5.10.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="jna"> - <dependencies> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna</artifactId> - <version>5.14.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna-platform</artifactId> - <version>5.14.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="jetty"> - <dependencies> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-http</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-io</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-security</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-server</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-servlet</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-util</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-util-ajax</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>jakarta.servlet</groupId> - <artifactId>jakarta.servlet-api</artifactId> - <version>4.0.4</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="javaewah"> - <dependencies> - <dependency> - <groupId>com.googlecode.javaewah</groupId> - <artifactId>JavaEWAH</artifactId> - <version>1.2.3</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="hamcrest"> - <dependencies> - <dependency> - <groupId>org.hamcrest</groupId> - <artifactId>hamcrest</artifactId> - <version>2.2</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="gson"> - <dependencies> - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - <version>2.10.1</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="bytebuddy"> - <dependencies> - <dependency> - <groupId>net.bytebuddy</groupId> - <artifactId>byte-buddy</artifactId> - <version>1.14.12</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>net.bytebuddy</groupId> - <artifactId>byte-buddy-agent</artifactId> - <version>1.14.12</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="bouncycastle"> - <dependencies> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcpg-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcprov-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcpkix-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcutil-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="assertj"> - <dependencies> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <version>3.25.3</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="args4j"> - <dependencies> - <dependency> - <groupId>args4j</groupId> - <artifactId>args4j</artifactId> - <version>2.33</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="apache"> - <dependencies> - <dependency> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> - <version>1.16.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-compress</artifactId> - <version>1.26.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>2.15.1</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <version>1.2</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - </locations> -</target>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.22.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.22.tpd deleted file mode 100644 index ecc776e..0000000 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.22.tpd +++ /dev/null
@@ -1,8 +0,0 @@ -target "jgit-4.22" with source configurePhase - -include "orbit/orbit-4.30.tpd" -include "maven/dependencies.tpd" - -location "https://download.eclipse.org/releases/2021-12/" { - org.eclipse.osgi lazy -}
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.23.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.23.target deleted file mode 100644 index e0786fd..0000000 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.23.target +++ /dev/null
@@ -1,278 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?pde?> -<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.23" sequenceNumber="1708457972"> - <locations> - <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> - <unit id="com.jcraft.jsch" version="0.1.55.v20230916-1400"/> - <unit id="com.jcraft.jsch.source" version="0.1.55.v20230916-1400"/> - <unit id="com.jcraft.jzlib" version="1.1.3.v20230916-1400"/> - <unit id="com.jcraft.jzlib.source" version="1.1.3.v20230916-1400"/> - <unit id="net.i2p.crypto.eddsa" version="0.3.0"/> - <unit id="net.i2p.crypto.eddsa.source" version="0.3.0"/> - <unit id="org.apache.ant" version="1.10.14.v20230922-1200"/> - <unit id="org.apache.ant.source" version="1.10.14.v20230922-1200"/> - <unit id="org.apache.httpcomponents.httpclient" version="4.5.14"/> - <unit id="org.apache.httpcomponents.httpclient.source" version="4.5.14"/> - <unit id="org.apache.httpcomponents.httpcore" version="4.4.16"/> - <unit id="org.apache.httpcomponents.httpcore.source" version="4.4.16"/> - <unit id="org.hamcrest.core" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.core.source" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.library" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.library.source" version="1.3.0.v20230809-1000"/> - <unit id="org.junit" version="4.13.2.v20230809-1000"/> - <unit id="org.junit.source" version="4.13.2.v20230809-1000"/> - <unit id="org.objenesis" version="3.3.0"/> - <unit id="org.objenesis.source" version="3.3.0"/> - <unit id="org.osgi.service.cm" version="1.6.1.202109301733"/> - <unit id="org.osgi.service.cm.source" version="1.6.1.202109301733"/> - <repository location="https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2023-12"/> - </location> - <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> - <unit id="org.eclipse.osgi" version="0.0.0"/> - <repository location="https://download.eclipse.org/releases/2022-03/"/> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="xz"> - <dependencies> - <dependency> - <groupId>org.tukaani</groupId> - <artifactId>xz</artifactId> - <version>1.9</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="slf4j"> - <dependencies> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>1.7.36</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-simple</artifactId> - <version>1.7.36</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="sshd"> - <dependencies> - <dependency> - <groupId>org.apache.sshd</groupId> - <artifactId>sshd-osgi</artifactId> - <version>2.12.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.apache.sshd</groupId> - <artifactId>sshd-sftp</artifactId> - <version>2.12.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="mockito"> - <dependencies> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <version>5.10.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="jna"> - <dependencies> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna</artifactId> - <version>5.14.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna-platform</artifactId> - <version>5.14.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="jetty"> - <dependencies> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-http</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-io</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-security</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-server</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-servlet</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-util</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-util-ajax</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>jakarta.servlet</groupId> - <artifactId>jakarta.servlet-api</artifactId> - <version>4.0.4</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="javaewah"> - <dependencies> - <dependency> - <groupId>com.googlecode.javaewah</groupId> - <artifactId>JavaEWAH</artifactId> - <version>1.2.3</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="hamcrest"> - <dependencies> - <dependency> - <groupId>org.hamcrest</groupId> - <artifactId>hamcrest</artifactId> - <version>2.2</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="gson"> - <dependencies> - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - <version>2.10.1</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="bytebuddy"> - <dependencies> - <dependency> - <groupId>net.bytebuddy</groupId> - <artifactId>byte-buddy</artifactId> - <version>1.14.12</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>net.bytebuddy</groupId> - <artifactId>byte-buddy-agent</artifactId> - <version>1.14.12</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="bouncycastle"> - <dependencies> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcpg-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcprov-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcpkix-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcutil-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="assertj"> - <dependencies> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <version>3.25.3</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="args4j"> - <dependencies> - <dependency> - <groupId>args4j</groupId> - <artifactId>args4j</artifactId> - <version>2.33</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="apache"> - <dependencies> - <dependency> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> - <version>1.16.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-compress</artifactId> - <version>1.26.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>2.15.1</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <version>1.2</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - </locations> -</target>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.23.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.23.tpd deleted file mode 100644 index 16efb40..0000000 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.23.tpd +++ /dev/null
@@ -1,8 +0,0 @@ -target "jgit-4.23" with source configurePhase - -include "orbit/orbit-4.30.tpd" -include "maven/dependencies.tpd" - -location "https://download.eclipse.org/releases/2022-03/" { - org.eclipse.osgi lazy -}
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.24.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.24.target deleted file mode 100644 index 4656b56..0000000 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.24.target +++ /dev/null
@@ -1,278 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?pde?> -<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.24" sequenceNumber="1708457972"> - <locations> - <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> - <unit id="com.jcraft.jsch" version="0.1.55.v20230916-1400"/> - <unit id="com.jcraft.jsch.source" version="0.1.55.v20230916-1400"/> - <unit id="com.jcraft.jzlib" version="1.1.3.v20230916-1400"/> - <unit id="com.jcraft.jzlib.source" version="1.1.3.v20230916-1400"/> - <unit id="net.i2p.crypto.eddsa" version="0.3.0"/> - <unit id="net.i2p.crypto.eddsa.source" version="0.3.0"/> - <unit id="org.apache.ant" version="1.10.14.v20230922-1200"/> - <unit id="org.apache.ant.source" version="1.10.14.v20230922-1200"/> - <unit id="org.apache.httpcomponents.httpclient" version="4.5.14"/> - <unit id="org.apache.httpcomponents.httpclient.source" version="4.5.14"/> - <unit id="org.apache.httpcomponents.httpcore" version="4.4.16"/> - <unit id="org.apache.httpcomponents.httpcore.source" version="4.4.16"/> - <unit id="org.hamcrest.core" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.core.source" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.library" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.library.source" version="1.3.0.v20230809-1000"/> - <unit id="org.junit" version="4.13.2.v20230809-1000"/> - <unit id="org.junit.source" version="4.13.2.v20230809-1000"/> - <unit id="org.objenesis" version="3.3.0"/> - <unit id="org.objenesis.source" version="3.3.0"/> - <unit id="org.osgi.service.cm" version="1.6.1.202109301733"/> - <unit id="org.osgi.service.cm.source" version="1.6.1.202109301733"/> - <repository location="https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2023-12"/> - </location> - <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> - <unit id="org.eclipse.osgi" version="0.0.0"/> - <repository location="https://download.eclipse.org/releases/2022-06/"/> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="xz"> - <dependencies> - <dependency> - <groupId>org.tukaani</groupId> - <artifactId>xz</artifactId> - <version>1.9</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="slf4j"> - <dependencies> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>1.7.36</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-simple</artifactId> - <version>1.7.36</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="sshd"> - <dependencies> - <dependency> - <groupId>org.apache.sshd</groupId> - <artifactId>sshd-osgi</artifactId> - <version>2.12.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.apache.sshd</groupId> - <artifactId>sshd-sftp</artifactId> - <version>2.12.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="mockito"> - <dependencies> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <version>5.10.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="jna"> - <dependencies> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna</artifactId> - <version>5.14.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna-platform</artifactId> - <version>5.14.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="jetty"> - <dependencies> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-http</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-io</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-security</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-server</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-servlet</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-util</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-util-ajax</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>jakarta.servlet</groupId> - <artifactId>jakarta.servlet-api</artifactId> - <version>4.0.4</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="javaewah"> - <dependencies> - <dependency> - <groupId>com.googlecode.javaewah</groupId> - <artifactId>JavaEWAH</artifactId> - <version>1.2.3</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="hamcrest"> - <dependencies> - <dependency> - <groupId>org.hamcrest</groupId> - <artifactId>hamcrest</artifactId> - <version>2.2</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="gson"> - <dependencies> - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - <version>2.10.1</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="bytebuddy"> - <dependencies> - <dependency> - <groupId>net.bytebuddy</groupId> - <artifactId>byte-buddy</artifactId> - <version>1.14.12</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>net.bytebuddy</groupId> - <artifactId>byte-buddy-agent</artifactId> - <version>1.14.12</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="bouncycastle"> - <dependencies> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcpg-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcprov-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcpkix-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcutil-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="assertj"> - <dependencies> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <version>3.25.3</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="args4j"> - <dependencies> - <dependency> - <groupId>args4j</groupId> - <artifactId>args4j</artifactId> - <version>2.33</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="apache"> - <dependencies> - <dependency> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> - <version>1.16.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-compress</artifactId> - <version>1.26.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>2.15.1</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <version>1.2</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - </locations> -</target>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.24.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.24.tpd deleted file mode 100644 index d0f8e8d..0000000 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.24.tpd +++ /dev/null
@@ -1,8 +0,0 @@ -target "jgit-4.24" with source configurePhase - -include "orbit/orbit-4.30.tpd" -include "maven/dependencies.tpd" - -location "https://download.eclipse.org/releases/2022-06/" { - org.eclipse.osgi lazy -}
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.25.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.25.target deleted file mode 100644 index efa79b3..0000000 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.25.target +++ /dev/null
@@ -1,278 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?pde?> -<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.25" sequenceNumber="1708457972"> - <locations> - <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> - <unit id="com.jcraft.jsch" version="0.1.55.v20230916-1400"/> - <unit id="com.jcraft.jsch.source" version="0.1.55.v20230916-1400"/> - <unit id="com.jcraft.jzlib" version="1.1.3.v20230916-1400"/> - <unit id="com.jcraft.jzlib.source" version="1.1.3.v20230916-1400"/> - <unit id="net.i2p.crypto.eddsa" version="0.3.0"/> - <unit id="net.i2p.crypto.eddsa.source" version="0.3.0"/> - <unit id="org.apache.ant" version="1.10.14.v20230922-1200"/> - <unit id="org.apache.ant.source" version="1.10.14.v20230922-1200"/> - <unit id="org.apache.httpcomponents.httpclient" version="4.5.14"/> - <unit id="org.apache.httpcomponents.httpclient.source" version="4.5.14"/> - <unit id="org.apache.httpcomponents.httpcore" version="4.4.16"/> - <unit id="org.apache.httpcomponents.httpcore.source" version="4.4.16"/> - <unit id="org.hamcrest.core" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.core.source" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.library" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.library.source" version="1.3.0.v20230809-1000"/> - <unit id="org.junit" version="4.13.2.v20230809-1000"/> - <unit id="org.junit.source" version="4.13.2.v20230809-1000"/> - <unit id="org.objenesis" version="3.3.0"/> - <unit id="org.objenesis.source" version="3.3.0"/> - <unit id="org.osgi.service.cm" version="1.6.1.202109301733"/> - <unit id="org.osgi.service.cm.source" version="1.6.1.202109301733"/> - <repository location="https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2023-12"/> - </location> - <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> - <unit id="org.eclipse.osgi" version="0.0.0"/> - <repository location="https://download.eclipse.org/releases/2022-09/"/> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="xz"> - <dependencies> - <dependency> - <groupId>org.tukaani</groupId> - <artifactId>xz</artifactId> - <version>1.9</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="slf4j"> - <dependencies> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>1.7.36</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-simple</artifactId> - <version>1.7.36</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="sshd"> - <dependencies> - <dependency> - <groupId>org.apache.sshd</groupId> - <artifactId>sshd-osgi</artifactId> - <version>2.12.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.apache.sshd</groupId> - <artifactId>sshd-sftp</artifactId> - <version>2.12.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="mockito"> - <dependencies> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <version>5.10.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="jna"> - <dependencies> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna</artifactId> - <version>5.14.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna-platform</artifactId> - <version>5.14.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="jetty"> - <dependencies> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-http</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-io</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-security</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-server</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-servlet</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-util</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-util-ajax</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>jakarta.servlet</groupId> - <artifactId>jakarta.servlet-api</artifactId> - <version>4.0.4</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="javaewah"> - <dependencies> - <dependency> - <groupId>com.googlecode.javaewah</groupId> - <artifactId>JavaEWAH</artifactId> - <version>1.2.3</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="hamcrest"> - <dependencies> - <dependency> - <groupId>org.hamcrest</groupId> - <artifactId>hamcrest</artifactId> - <version>2.2</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="gson"> - <dependencies> - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - <version>2.10.1</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="bytebuddy"> - <dependencies> - <dependency> - <groupId>net.bytebuddy</groupId> - <artifactId>byte-buddy</artifactId> - <version>1.14.12</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>net.bytebuddy</groupId> - <artifactId>byte-buddy-agent</artifactId> - <version>1.14.12</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="bouncycastle"> - <dependencies> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcpg-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcprov-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcpkix-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcutil-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="assertj"> - <dependencies> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <version>3.25.3</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="args4j"> - <dependencies> - <dependency> - <groupId>args4j</groupId> - <artifactId>args4j</artifactId> - <version>2.33</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="apache"> - <dependencies> - <dependency> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> - <version>1.16.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-compress</artifactId> - <version>1.26.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>2.15.1</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <version>1.2</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - </locations> -</target>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.25.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.25.tpd deleted file mode 100644 index be37c10..0000000 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.25.tpd +++ /dev/null
@@ -1,8 +0,0 @@ -target "jgit-4.25" with source configurePhase - -include "orbit/orbit-4.30.tpd" -include "maven/dependencies.tpd" - -location "https://download.eclipse.org/releases/2022-09/" { - org.eclipse.osgi lazy -}
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.26.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.26.target deleted file mode 100644 index a432bbb..0000000 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.26.target +++ /dev/null
@@ -1,278 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?pde?> -<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.26" sequenceNumber="1708457970"> - <locations> - <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> - <unit id="com.jcraft.jsch" version="0.1.55.v20230916-1400"/> - <unit id="com.jcraft.jsch.source" version="0.1.55.v20230916-1400"/> - <unit id="com.jcraft.jzlib" version="1.1.3.v20230916-1400"/> - <unit id="com.jcraft.jzlib.source" version="1.1.3.v20230916-1400"/> - <unit id="net.i2p.crypto.eddsa" version="0.3.0"/> - <unit id="net.i2p.crypto.eddsa.source" version="0.3.0"/> - <unit id="org.apache.ant" version="1.10.14.v20230922-1200"/> - <unit id="org.apache.ant.source" version="1.10.14.v20230922-1200"/> - <unit id="org.apache.httpcomponents.httpclient" version="4.5.14"/> - <unit id="org.apache.httpcomponents.httpclient.source" version="4.5.14"/> - <unit id="org.apache.httpcomponents.httpcore" version="4.4.16"/> - <unit id="org.apache.httpcomponents.httpcore.source" version="4.4.16"/> - <unit id="org.hamcrest.core" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.core.source" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.library" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.library.source" version="1.3.0.v20230809-1000"/> - <unit id="org.junit" version="4.13.2.v20230809-1000"/> - <unit id="org.junit.source" version="4.13.2.v20230809-1000"/> - <unit id="org.objenesis" version="3.3.0"/> - <unit id="org.objenesis.source" version="3.3.0"/> - <unit id="org.osgi.service.cm" version="1.6.1.202109301733"/> - <unit id="org.osgi.service.cm.source" version="1.6.1.202109301733"/> - <repository location="https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2023-12"/> - </location> - <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> - <unit id="org.eclipse.osgi" version="0.0.0"/> - <repository location="https://download.eclipse.org/releases/2022-12/"/> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="xz"> - <dependencies> - <dependency> - <groupId>org.tukaani</groupId> - <artifactId>xz</artifactId> - <version>1.9</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="slf4j"> - <dependencies> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>1.7.36</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-simple</artifactId> - <version>1.7.36</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="sshd"> - <dependencies> - <dependency> - <groupId>org.apache.sshd</groupId> - <artifactId>sshd-osgi</artifactId> - <version>2.12.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.apache.sshd</groupId> - <artifactId>sshd-sftp</artifactId> - <version>2.12.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="mockito"> - <dependencies> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <version>5.10.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="jna"> - <dependencies> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna</artifactId> - <version>5.14.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna-platform</artifactId> - <version>5.14.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="jetty"> - <dependencies> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-http</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-io</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-security</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-server</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-servlet</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-util</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-util-ajax</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>jakarta.servlet</groupId> - <artifactId>jakarta.servlet-api</artifactId> - <version>4.0.4</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="javaewah"> - <dependencies> - <dependency> - <groupId>com.googlecode.javaewah</groupId> - <artifactId>JavaEWAH</artifactId> - <version>1.2.3</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="hamcrest"> - <dependencies> - <dependency> - <groupId>org.hamcrest</groupId> - <artifactId>hamcrest</artifactId> - <version>2.2</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="gson"> - <dependencies> - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - <version>2.10.1</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="bytebuddy"> - <dependencies> - <dependency> - <groupId>net.bytebuddy</groupId> - <artifactId>byte-buddy</artifactId> - <version>1.14.12</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>net.bytebuddy</groupId> - <artifactId>byte-buddy-agent</artifactId> - <version>1.14.12</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="bouncycastle"> - <dependencies> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcpg-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcprov-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcpkix-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcutil-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="assertj"> - <dependencies> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <version>3.25.3</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="args4j"> - <dependencies> - <dependency> - <groupId>args4j</groupId> - <artifactId>args4j</artifactId> - <version>2.33</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="apache"> - <dependencies> - <dependency> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> - <version>1.16.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-compress</artifactId> - <version>1.26.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>2.15.1</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <version>1.2</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - </locations> -</target>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.26.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.26.tpd deleted file mode 100644 index e269919..0000000 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.26.tpd +++ /dev/null
@@ -1,8 +0,0 @@ -target "jgit-4.26" with source configurePhase - -include "orbit/orbit-4.30.tpd" -include "maven/dependencies.tpd" - -location "https://download.eclipse.org/releases/2022-12/" { - org.eclipse.osgi lazy -}
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.27.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.27.target deleted file mode 100644 index 4b91238..0000000 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.27.target +++ /dev/null
@@ -1,278 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?pde?> -<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.27" sequenceNumber="1708457970"> - <locations> - <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> - <unit id="com.jcraft.jsch" version="0.1.55.v20230916-1400"/> - <unit id="com.jcraft.jsch.source" version="0.1.55.v20230916-1400"/> - <unit id="com.jcraft.jzlib" version="1.1.3.v20230916-1400"/> - <unit id="com.jcraft.jzlib.source" version="1.1.3.v20230916-1400"/> - <unit id="net.i2p.crypto.eddsa" version="0.3.0"/> - <unit id="net.i2p.crypto.eddsa.source" version="0.3.0"/> - <unit id="org.apache.ant" version="1.10.14.v20230922-1200"/> - <unit id="org.apache.ant.source" version="1.10.14.v20230922-1200"/> - <unit id="org.apache.httpcomponents.httpclient" version="4.5.14"/> - <unit id="org.apache.httpcomponents.httpclient.source" version="4.5.14"/> - <unit id="org.apache.httpcomponents.httpcore" version="4.4.16"/> - <unit id="org.apache.httpcomponents.httpcore.source" version="4.4.16"/> - <unit id="org.hamcrest.core" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.core.source" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.library" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.library.source" version="1.3.0.v20230809-1000"/> - <unit id="org.junit" version="4.13.2.v20230809-1000"/> - <unit id="org.junit.source" version="4.13.2.v20230809-1000"/> - <unit id="org.objenesis" version="3.3.0"/> - <unit id="org.objenesis.source" version="3.3.0"/> - <unit id="org.osgi.service.cm" version="1.6.1.202109301733"/> - <unit id="org.osgi.service.cm.source" version="1.6.1.202109301733"/> - <repository location="https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2023-12"/> - </location> - <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> - <unit id="org.eclipse.osgi" version="0.0.0"/> - <repository location="https://download.eclipse.org/releases/2023-03/"/> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="xz"> - <dependencies> - <dependency> - <groupId>org.tukaani</groupId> - <artifactId>xz</artifactId> - <version>1.9</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="slf4j"> - <dependencies> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>1.7.36</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-simple</artifactId> - <version>1.7.36</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="sshd"> - <dependencies> - <dependency> - <groupId>org.apache.sshd</groupId> - <artifactId>sshd-osgi</artifactId> - <version>2.12.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.apache.sshd</groupId> - <artifactId>sshd-sftp</artifactId> - <version>2.12.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="mockito"> - <dependencies> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <version>5.10.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="jna"> - <dependencies> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna</artifactId> - <version>5.14.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna-platform</artifactId> - <version>5.14.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="jetty"> - <dependencies> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-http</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-io</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-security</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-server</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-servlet</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-util</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-util-ajax</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>jakarta.servlet</groupId> - <artifactId>jakarta.servlet-api</artifactId> - <version>4.0.4</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="javaewah"> - <dependencies> - <dependency> - <groupId>com.googlecode.javaewah</groupId> - <artifactId>JavaEWAH</artifactId> - <version>1.2.3</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="hamcrest"> - <dependencies> - <dependency> - <groupId>org.hamcrest</groupId> - <artifactId>hamcrest</artifactId> - <version>2.2</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="gson"> - <dependencies> - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - <version>2.10.1</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="bytebuddy"> - <dependencies> - <dependency> - <groupId>net.bytebuddy</groupId> - <artifactId>byte-buddy</artifactId> - <version>1.14.12</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>net.bytebuddy</groupId> - <artifactId>byte-buddy-agent</artifactId> - <version>1.14.12</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="bouncycastle"> - <dependencies> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcpg-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcprov-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcpkix-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcutil-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="assertj"> - <dependencies> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <version>3.25.3</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="args4j"> - <dependencies> - <dependency> - <groupId>args4j</groupId> - <artifactId>args4j</artifactId> - <version>2.33</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="apache"> - <dependencies> - <dependency> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> - <version>1.16.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-compress</artifactId> - <version>1.26.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>2.15.1</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <version>1.2</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - </locations> -</target>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.27.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.27.tpd deleted file mode 100644 index b67718a..0000000 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.27.tpd +++ /dev/null
@@ -1,8 +0,0 @@ -target "jgit-4.27" with source configurePhase - -include "orbit/orbit-4.30.tpd" -include "maven/dependencies.tpd" - -location "https://download.eclipse.org/releases/2023-03/" { - org.eclipse.osgi lazy -}
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.28.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.28.target deleted file mode 100644 index 7dc8dd8..0000000 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.28.target +++ /dev/null
@@ -1,278 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?pde?> -<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.28" sequenceNumber="1708457970"> - <locations> - <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> - <unit id="com.jcraft.jsch" version="0.1.55.v20230916-1400"/> - <unit id="com.jcraft.jsch.source" version="0.1.55.v20230916-1400"/> - <unit id="com.jcraft.jzlib" version="1.1.3.v20230916-1400"/> - <unit id="com.jcraft.jzlib.source" version="1.1.3.v20230916-1400"/> - <unit id="net.i2p.crypto.eddsa" version="0.3.0"/> - <unit id="net.i2p.crypto.eddsa.source" version="0.3.0"/> - <unit id="org.apache.ant" version="1.10.14.v20230922-1200"/> - <unit id="org.apache.ant.source" version="1.10.14.v20230922-1200"/> - <unit id="org.apache.httpcomponents.httpclient" version="4.5.14"/> - <unit id="org.apache.httpcomponents.httpclient.source" version="4.5.14"/> - <unit id="org.apache.httpcomponents.httpcore" version="4.4.16"/> - <unit id="org.apache.httpcomponents.httpcore.source" version="4.4.16"/> - <unit id="org.hamcrest.core" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.core.source" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.library" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.library.source" version="1.3.0.v20230809-1000"/> - <unit id="org.junit" version="4.13.2.v20230809-1000"/> - <unit id="org.junit.source" version="4.13.2.v20230809-1000"/> - <unit id="org.objenesis" version="3.3.0"/> - <unit id="org.objenesis.source" version="3.3.0"/> - <unit id="org.osgi.service.cm" version="1.6.1.202109301733"/> - <unit id="org.osgi.service.cm.source" version="1.6.1.202109301733"/> - <repository location="https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2023-12"/> - </location> - <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> - <unit id="org.eclipse.osgi" version="0.0.0"/> - <repository location="https://download.eclipse.org/releases/2023-06"/> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="xz"> - <dependencies> - <dependency> - <groupId>org.tukaani</groupId> - <artifactId>xz</artifactId> - <version>1.9</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="slf4j"> - <dependencies> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>1.7.36</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-simple</artifactId> - <version>1.7.36</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="sshd"> - <dependencies> - <dependency> - <groupId>org.apache.sshd</groupId> - <artifactId>sshd-osgi</artifactId> - <version>2.12.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.apache.sshd</groupId> - <artifactId>sshd-sftp</artifactId> - <version>2.12.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="mockito"> - <dependencies> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <version>5.10.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="jna"> - <dependencies> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna</artifactId> - <version>5.14.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna-platform</artifactId> - <version>5.14.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="jetty"> - <dependencies> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-http</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-io</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-security</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-server</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-servlet</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-util</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-util-ajax</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>jakarta.servlet</groupId> - <artifactId>jakarta.servlet-api</artifactId> - <version>4.0.4</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="javaewah"> - <dependencies> - <dependency> - <groupId>com.googlecode.javaewah</groupId> - <artifactId>JavaEWAH</artifactId> - <version>1.2.3</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="hamcrest"> - <dependencies> - <dependency> - <groupId>org.hamcrest</groupId> - <artifactId>hamcrest</artifactId> - <version>2.2</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="gson"> - <dependencies> - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - <version>2.10.1</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="bytebuddy"> - <dependencies> - <dependency> - <groupId>net.bytebuddy</groupId> - <artifactId>byte-buddy</artifactId> - <version>1.14.12</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>net.bytebuddy</groupId> - <artifactId>byte-buddy-agent</artifactId> - <version>1.14.12</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="bouncycastle"> - <dependencies> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcpg-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcprov-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcpkix-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcutil-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="assertj"> - <dependencies> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <version>3.25.3</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="args4j"> - <dependencies> - <dependency> - <groupId>args4j</groupId> - <artifactId>args4j</artifactId> - <version>2.33</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="apache"> - <dependencies> - <dependency> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> - <version>1.16.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-compress</artifactId> - <version>1.26.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>2.15.1</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <version>1.2</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - </locations> -</target>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.28.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.28.tpd deleted file mode 100644 index 1a9a22a..0000000 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.28.tpd +++ /dev/null
@@ -1,8 +0,0 @@ -target "jgit-4.28" with source configurePhase - -include "orbit/orbit-4.30.tpd" -include "maven/dependencies.tpd" - -location "https://download.eclipse.org/releases/2023-06" { - org.eclipse.osgi lazy -}
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.29.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.29.target deleted file mode 100644 index d86ea28..0000000 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.29.target +++ /dev/null
@@ -1,278 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?pde?> -<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.29" sequenceNumber="1708457970"> - <locations> - <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> - <unit id="com.jcraft.jsch" version="0.1.55.v20230916-1400"/> - <unit id="com.jcraft.jsch.source" version="0.1.55.v20230916-1400"/> - <unit id="com.jcraft.jzlib" version="1.1.3.v20230916-1400"/> - <unit id="com.jcraft.jzlib.source" version="1.1.3.v20230916-1400"/> - <unit id="net.i2p.crypto.eddsa" version="0.3.0"/> - <unit id="net.i2p.crypto.eddsa.source" version="0.3.0"/> - <unit id="org.apache.ant" version="1.10.14.v20230922-1200"/> - <unit id="org.apache.ant.source" version="1.10.14.v20230922-1200"/> - <unit id="org.apache.httpcomponents.httpclient" version="4.5.14"/> - <unit id="org.apache.httpcomponents.httpclient.source" version="4.5.14"/> - <unit id="org.apache.httpcomponents.httpcore" version="4.4.16"/> - <unit id="org.apache.httpcomponents.httpcore.source" version="4.4.16"/> - <unit id="org.hamcrest.core" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.core.source" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.library" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.library.source" version="1.3.0.v20230809-1000"/> - <unit id="org.junit" version="4.13.2.v20230809-1000"/> - <unit id="org.junit.source" version="4.13.2.v20230809-1000"/> - <unit id="org.objenesis" version="3.3.0"/> - <unit id="org.objenesis.source" version="3.3.0"/> - <unit id="org.osgi.service.cm" version="1.6.1.202109301733"/> - <unit id="org.osgi.service.cm.source" version="1.6.1.202109301733"/> - <repository location="https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2023-12"/> - </location> - <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> - <unit id="org.eclipse.osgi" version="0.0.0"/> - <repository location="https://download.eclipse.org/releases/2023-09"/> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="xz"> - <dependencies> - <dependency> - <groupId>org.tukaani</groupId> - <artifactId>xz</artifactId> - <version>1.9</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="slf4j"> - <dependencies> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>1.7.36</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-simple</artifactId> - <version>1.7.36</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="sshd"> - <dependencies> - <dependency> - <groupId>org.apache.sshd</groupId> - <artifactId>sshd-osgi</artifactId> - <version>2.12.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.apache.sshd</groupId> - <artifactId>sshd-sftp</artifactId> - <version>2.12.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="mockito"> - <dependencies> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <version>5.10.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="jna"> - <dependencies> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna</artifactId> - <version>5.14.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna-platform</artifactId> - <version>5.14.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="jetty"> - <dependencies> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-http</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-io</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-security</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-server</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-servlet</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-util</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-util-ajax</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>jakarta.servlet</groupId> - <artifactId>jakarta.servlet-api</artifactId> - <version>4.0.4</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="javaewah"> - <dependencies> - <dependency> - <groupId>com.googlecode.javaewah</groupId> - <artifactId>JavaEWAH</artifactId> - <version>1.2.3</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="hamcrest"> - <dependencies> - <dependency> - <groupId>org.hamcrest</groupId> - <artifactId>hamcrest</artifactId> - <version>2.2</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="gson"> - <dependencies> - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - <version>2.10.1</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="bytebuddy"> - <dependencies> - <dependency> - <groupId>net.bytebuddy</groupId> - <artifactId>byte-buddy</artifactId> - <version>1.14.12</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>net.bytebuddy</groupId> - <artifactId>byte-buddy-agent</artifactId> - <version>1.14.12</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="bouncycastle"> - <dependencies> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcpg-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcprov-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcpkix-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcutil-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="assertj"> - <dependencies> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <version>3.25.3</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="args4j"> - <dependencies> - <dependency> - <groupId>args4j</groupId> - <artifactId>args4j</artifactId> - <version>2.33</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="apache"> - <dependencies> - <dependency> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> - <version>1.16.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-compress</artifactId> - <version>1.26.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>2.15.1</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <version>1.2</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - </locations> -</target>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.29.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.29.tpd deleted file mode 100644 index 4e34280..0000000 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.29.tpd +++ /dev/null
@@ -1,8 +0,0 @@ -target "jgit-4.29" with source configurePhase - -include "orbit/orbit-4.30.tpd" -include "maven/dependencies.tpd" - -location "https://download.eclipse.org/releases/2023-09" { - org.eclipse.osgi lazy -}
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.30.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.30.target deleted file mode 100644 index afd4d32..0000000 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.30.target +++ /dev/null
@@ -1,278 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?pde?> -<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.30" sequenceNumber="1708457970"> - <locations> - <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> - <unit id="com.jcraft.jsch" version="0.1.55.v20230916-1400"/> - <unit id="com.jcraft.jsch.source" version="0.1.55.v20230916-1400"/> - <unit id="com.jcraft.jzlib" version="1.1.3.v20230916-1400"/> - <unit id="com.jcraft.jzlib.source" version="1.1.3.v20230916-1400"/> - <unit id="net.i2p.crypto.eddsa" version="0.3.0"/> - <unit id="net.i2p.crypto.eddsa.source" version="0.3.0"/> - <unit id="org.apache.ant" version="1.10.14.v20230922-1200"/> - <unit id="org.apache.ant.source" version="1.10.14.v20230922-1200"/> - <unit id="org.apache.httpcomponents.httpclient" version="4.5.14"/> - <unit id="org.apache.httpcomponents.httpclient.source" version="4.5.14"/> - <unit id="org.apache.httpcomponents.httpcore" version="4.4.16"/> - <unit id="org.apache.httpcomponents.httpcore.source" version="4.4.16"/> - <unit id="org.hamcrest.core" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.core.source" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.library" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.library.source" version="1.3.0.v20230809-1000"/> - <unit id="org.junit" version="4.13.2.v20230809-1000"/> - <unit id="org.junit.source" version="4.13.2.v20230809-1000"/> - <unit id="org.objenesis" version="3.3.0"/> - <unit id="org.objenesis.source" version="3.3.0"/> - <unit id="org.osgi.service.cm" version="1.6.1.202109301733"/> - <unit id="org.osgi.service.cm.source" version="1.6.1.202109301733"/> - <repository location="https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2023-12"/> - </location> - <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> - <unit id="org.eclipse.osgi" version="0.0.0"/> - <repository location="https://download.eclipse.org/staging/2023-12/"/> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="xz"> - <dependencies> - <dependency> - <groupId>org.tukaani</groupId> - <artifactId>xz</artifactId> - <version>1.9</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="slf4j"> - <dependencies> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>1.7.36</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-simple</artifactId> - <version>1.7.36</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="sshd"> - <dependencies> - <dependency> - <groupId>org.apache.sshd</groupId> - <artifactId>sshd-osgi</artifactId> - <version>2.12.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.apache.sshd</groupId> - <artifactId>sshd-sftp</artifactId> - <version>2.12.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="mockito"> - <dependencies> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <version>5.10.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="jna"> - <dependencies> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna</artifactId> - <version>5.14.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna-platform</artifactId> - <version>5.14.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="jetty"> - <dependencies> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-http</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-io</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-security</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-server</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-servlet</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-util</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-util-ajax</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>jakarta.servlet</groupId> - <artifactId>jakarta.servlet-api</artifactId> - <version>4.0.4</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="javaewah"> - <dependencies> - <dependency> - <groupId>com.googlecode.javaewah</groupId> - <artifactId>JavaEWAH</artifactId> - <version>1.2.3</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="hamcrest"> - <dependencies> - <dependency> - <groupId>org.hamcrest</groupId> - <artifactId>hamcrest</artifactId> - <version>2.2</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="gson"> - <dependencies> - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - <version>2.10.1</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="bytebuddy"> - <dependencies> - <dependency> - <groupId>net.bytebuddy</groupId> - <artifactId>byte-buddy</artifactId> - <version>1.14.12</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>net.bytebuddy</groupId> - <artifactId>byte-buddy-agent</artifactId> - <version>1.14.12</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="bouncycastle"> - <dependencies> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcpg-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcprov-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcpkix-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcutil-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="assertj"> - <dependencies> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <version>3.25.3</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="args4j"> - <dependencies> - <dependency> - <groupId>args4j</groupId> - <artifactId>args4j</artifactId> - <version>2.33</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="apache"> - <dependencies> - <dependency> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> - <version>1.16.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-compress</artifactId> - <version>1.26.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>2.15.1</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <version>1.2</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - </locations> -</target>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.30.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.30.tpd deleted file mode 100644 index dfb4474..0000000 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.30.tpd +++ /dev/null
@@ -1,8 +0,0 @@ -target "jgit-4.30" with source configurePhase - -include "orbit/orbit-4.30.tpd" -include "maven/dependencies.tpd" - -location "https://download.eclipse.org/staging/2023-12/" { - org.eclipse.osgi lazy -}
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.31.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.31.target deleted file mode 100644 index d95197a..0000000 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.31.target +++ /dev/null
@@ -1,278 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?pde?> -<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.31" sequenceNumber="1708457970"> - <locations> - <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> - <unit id="com.jcraft.jsch" version="0.1.55.v20230916-1400"/> - <unit id="com.jcraft.jsch.source" version="0.1.55.v20230916-1400"/> - <unit id="com.jcraft.jzlib" version="1.1.3.v20230916-1400"/> - <unit id="com.jcraft.jzlib.source" version="1.1.3.v20230916-1400"/> - <unit id="net.i2p.crypto.eddsa" version="0.3.0"/> - <unit id="net.i2p.crypto.eddsa.source" version="0.3.0"/> - <unit id="org.apache.ant" version="1.10.14.v20230922-1200"/> - <unit id="org.apache.ant.source" version="1.10.14.v20230922-1200"/> - <unit id="org.apache.httpcomponents.httpclient" version="4.5.14"/> - <unit id="org.apache.httpcomponents.httpclient.source" version="4.5.14"/> - <unit id="org.apache.httpcomponents.httpcore" version="4.4.16"/> - <unit id="org.apache.httpcomponents.httpcore.source" version="4.4.16"/> - <unit id="org.hamcrest.core" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.core.source" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.library" version="1.3.0.v20230809-1000"/> - <unit id="org.hamcrest.library.source" version="1.3.0.v20230809-1000"/> - <unit id="org.junit" version="4.13.2.v20230809-1000"/> - <unit id="org.junit.source" version="4.13.2.v20230809-1000"/> - <unit id="org.objenesis" version="3.3.0"/> - <unit id="org.objenesis.source" version="3.3.0"/> - <unit id="org.osgi.service.cm" version="1.6.1.202109301733"/> - <unit id="org.osgi.service.cm.source" version="1.6.1.202109301733"/> - <repository location="https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2023-12"/> - </location> - <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> - <unit id="org.eclipse.osgi" version="0.0.0"/> - <repository location="https://download.eclipse.org/staging/2024-03/"/> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="xz"> - <dependencies> - <dependency> - <groupId>org.tukaani</groupId> - <artifactId>xz</artifactId> - <version>1.9</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="slf4j"> - <dependencies> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>1.7.36</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-simple</artifactId> - <version>1.7.36</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="sshd"> - <dependencies> - <dependency> - <groupId>org.apache.sshd</groupId> - <artifactId>sshd-osgi</artifactId> - <version>2.12.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.apache.sshd</groupId> - <artifactId>sshd-sftp</artifactId> - <version>2.12.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="mockito"> - <dependencies> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <version>5.10.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="jna"> - <dependencies> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna</artifactId> - <version>5.14.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna-platform</artifactId> - <version>5.14.0</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="jetty"> - <dependencies> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-http</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-io</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-security</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-server</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-servlet</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-util</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-util-ajax</artifactId> - <version>10.0.20</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>jakarta.servlet</groupId> - <artifactId>jakarta.servlet-api</artifactId> - <version>4.0.4</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="javaewah"> - <dependencies> - <dependency> - <groupId>com.googlecode.javaewah</groupId> - <artifactId>JavaEWAH</artifactId> - <version>1.2.3</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="hamcrest"> - <dependencies> - <dependency> - <groupId>org.hamcrest</groupId> - <artifactId>hamcrest</artifactId> - <version>2.2</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="gson"> - <dependencies> - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - <version>2.10.1</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="bytebuddy"> - <dependencies> - <dependency> - <groupId>net.bytebuddy</groupId> - <artifactId>byte-buddy</artifactId> - <version>1.14.12</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>net.bytebuddy</groupId> - <artifactId>byte-buddy-agent</artifactId> - <version>1.14.12</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="bouncycastle"> - <dependencies> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcpg-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcprov-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcpkix-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcutil-jdk18on</artifactId> - <version>1.77</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="assertj"> - <dependencies> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <version>3.25.3</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="args4j"> - <dependencies> - <dependency> - <groupId>args4j</groupId> - <artifactId>args4j</artifactId> - <version>2.33</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="apache"> - <dependencies> - <dependency> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> - <version>1.16.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-compress</artifactId> - <version>1.26.0</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>2.15.1</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <version>1.2</version> - <type>jar</type> - </dependency> - </dependencies> - </location> - </locations> -</target>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.31.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.31.tpd deleted file mode 100644 index 58491c8..0000000 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.31.tpd +++ /dev/null
@@ -1,8 +0,0 @@ -target "jgit-4.31" with source configurePhase - -include "orbit/orbit-4.31.tpd" -include "maven/dependencies.tpd" - -location "https://download.eclipse.org/staging/2024-03/" { - org.eclipse.osgi lazy -}
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.21.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.32.target similarity index 88% rename from org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.21.target rename to org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.32.target index 5f78752..b254725 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.21.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.32.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.21" sequenceNumber="1753176605"> +<target name="jgit-4.32" sequenceNumber="1728511223"> <locations> <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> <unit id="com.jcraft.jsch" version="0.1.55.v20230916-1400"/> @@ -22,15 +22,15 @@ <unit id="org.hamcrest.library.source" version="1.3.0.v20230809-1000"/> <unit id="org.junit" version="4.13.2.v20230809-1000"/> <unit id="org.junit.source" version="4.13.2.v20230809-1000"/> - <unit id="org.objenesis" version="3.3.0"/> - <unit id="org.objenesis.source" version="3.3.0"/> + <unit id="org.objenesis" version="3.4.0"/> + <unit id="org.objenesis.source" version="3.4.0"/> <unit id="org.osgi.service.cm" version="1.6.1.202109301733"/> <unit id="org.osgi.service.cm.source" version="1.6.1.202109301733"/> - <repository location="https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2023-12"/> + <repository location="https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2024-06"/> </location> <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> <unit id="org.eclipse.osgi" version="0.0.0"/> - <repository location="https://download.eclipse.org/releases/2021-12/"/> + <repository location="https://download.eclipse.org/staging/2024-06/"/> </location> <location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="error" type="Maven" label="xz"> <dependencies> @@ -63,13 +63,13 @@ <dependency> <groupId>org.apache.sshd</groupId> <artifactId>sshd-osgi</artifactId> - <version>2.12.0</version> + <version>2.14.0</version> <type>jar</type> </dependency> <dependency> <groupId>org.apache.sshd</groupId> <artifactId>sshd-sftp</artifactId> - <version>2.12.0</version> + <version>2.14.0</version> <type>jar</type> </dependency> </dependencies> @@ -79,7 +79,7 @@ <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> - <version>5.10.0</version> + <version>5.12.0</version> <type>jar</type> </dependency> </dependencies> @@ -105,43 +105,43 @@ <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-http</artifactId> - <version>10.0.20</version> + <version>10.0.21</version> <type>jar</type> </dependency> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-io</artifactId> - <version>10.0.20</version> + <version>10.0.21</version> <type>jar</type> </dependency> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-security</artifactId> - <version>10.0.20</version> + <version>10.0.21</version> <type>jar</type> </dependency> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-server</artifactId> - <version>10.0.20</version> + <version>10.0.21</version> <type>jar</type> </dependency> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-servlet</artifactId> - <version>10.0.20</version> + <version>10.0.21</version> <type>jar</type> </dependency> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-util</artifactId> - <version>10.0.20</version> + <version>10.0.21</version> <type>jar</type> </dependency> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-util-ajax</artifactId> - <version>10.0.20</version> + <version>10.0.21</version> <type>jar</type> </dependency> <dependency> @@ -177,7 +177,7 @@ <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> - <version>2.10.1</version> + <version>2.11.0</version> <type>jar</type> </dependency> </dependencies> @@ -187,13 +187,13 @@ <dependency> <groupId>net.bytebuddy</groupId> <artifactId>byte-buddy</artifactId> - <version>1.14.12</version> + <version>1.14.16</version> <type>jar</type> </dependency> <dependency> <groupId>net.bytebuddy</groupId> <artifactId>byte-buddy-agent</artifactId> - <version>1.14.12</version> + <version>1.14.16</version> <type>jar</type> </dependency> </dependencies> @@ -203,25 +203,25 @@ <dependency> <groupId>org.bouncycastle</groupId> <artifactId>bcpg-jdk18on</artifactId> - <version>1.77</version> + <version>1.78.1</version> <type>jar</type> </dependency> <dependency> <groupId>org.bouncycastle</groupId> <artifactId>bcprov-jdk18on</artifactId> - <version>1.77</version> + <version>1.78.1</version> <type>jar</type> </dependency> <dependency> <groupId>org.bouncycastle</groupId> <artifactId>bcpkix-jdk18on</artifactId> - <version>1.77</version> + <version>1.78.1</version> <type>jar</type> </dependency> <dependency> <groupId>org.bouncycastle</groupId> <artifactId>bcutil-jdk18on</artifactId> - <version>1.77</version> + <version>1.78.1</version> <type>jar</type> </dependency> </dependencies> @@ -231,7 +231,7 @@ <dependency> <groupId>org.assertj</groupId> <artifactId>assertj-core</artifactId> - <version>3.25.3</version> + <version>3.26.0</version> <type>jar</type> </dependency> </dependencies> @@ -241,7 +241,7 @@ <dependency> <groupId>args4j</groupId> <artifactId>args4j</artifactId> - <version>2.33</version> + <version>2.37</version> <type>jar</type> </dependency> </dependencies> @@ -251,25 +251,31 @@ <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> - <version>1.16.0</version> + <version>1.17.0</version> <type>jar</type> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-compress</artifactId> - <version>1.26.0</version> + <version>1.26.2</version> + <type>jar</type> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <version>3.14.0</version> <type>jar</type> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> - <version>2.15.1</version> + <version>2.16.1</version> <type>jar</type> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> - <version>1.2</version> + <version>1.3.2</version> <type>jar</type> </dependency> </dependencies>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.32.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.32.tpd new file mode 100644 index 0000000..b8574c7 --- /dev/null +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.32.tpd
@@ -0,0 +1,8 @@ +target "jgit-4.32" with source configurePhase + +include "orbit/orbit-4.32.tpd" +include "maven/dependencies.tpd" + +location "https://download.eclipse.org/staging/2024-06/" { + org.eclipse.osgi lazy +}
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/maven/dependencies.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/maven/dependencies.tpd index 8347389..7aae03b 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/maven/dependencies.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/maven/dependencies.tpd
@@ -10,22 +10,27 @@ dependency { groupId = "commons-codec" artifactId = "commons-codec" - version = "1.16.0" + version = "1.17.0" } dependency { groupId = "org.apache.commons" artifactId = "commons-compress" - version = "1.26.0" + version = "1.26.2" + } + dependency { + groupId = "org.apache.commons" + artifactId = "commons-lang3" + version = "3.14.0" } dependency { groupId = "commons-io" artifactId = "commons-io" - version = "2.15.1" + version = "2.16.1" } dependency { groupId = "commons-logging" artifactId = "commons-logging" - version = "1.2" + version = "1.3.2" } } @@ -38,7 +43,7 @@ dependency { groupId = "args4j" artifactId = "args4j" - version = "2.33" + version = "2.37" } } @@ -51,7 +56,7 @@ dependency { groupId = "org.assertj" artifactId = "assertj-core" - version = "3.25.3" + version = "3.26.0" } } @@ -64,22 +69,22 @@ dependency { groupId = "org.bouncycastle" artifactId = "bcpg-jdk18on" - version = "1.77" + version = "1.78.1" } dependency { groupId = "org.bouncycastle" artifactId = "bcprov-jdk18on" - version = "1.77" + version = "1.78.1" } dependency { groupId = "org.bouncycastle" artifactId = "bcpkix-jdk18on" - version = "1.77" + version = "1.78.1" } dependency { groupId = "org.bouncycastle" artifactId = "bcutil-jdk18on" - version = "1.77" + version = "1.78.1" } } @@ -92,12 +97,12 @@ dependency { groupId = "net.bytebuddy" artifactId = "byte-buddy" - version = "1.14.12" + version = "1.14.16" } dependency { groupId = "net.bytebuddy" artifactId = "byte-buddy-agent" - version = "1.14.12" + version = "1.14.16" } } @@ -110,7 +115,7 @@ dependency { groupId = "com.google.code.gson" artifactId = "gson" - version = "2.10.1" + version = "2.11.0" } } @@ -149,37 +154,37 @@ dependency { groupId = "org.eclipse.jetty" artifactId = "jetty-http" - version = "10.0.20" + version = "10.0.21" } dependency { groupId = "org.eclipse.jetty" artifactId = "jetty-io" - version = "10.0.20" + version = "10.0.21" } dependency { groupId = "org.eclipse.jetty" artifactId = "jetty-security" - version = "10.0.20" + version = "10.0.21" } dependency { groupId = "org.eclipse.jetty" artifactId = "jetty-server" - version = "10.0.20" + version = "10.0.21" } dependency { groupId = "org.eclipse.jetty" artifactId = "jetty-servlet" - version = "10.0.20" + version = "10.0.21" } dependency { groupId = "org.eclipse.jetty" artifactId = "jetty-util" - version = "10.0.20" + version = "10.0.21" } dependency { groupId = "org.eclipse.jetty" artifactId = "jetty-util-ajax" - version = "10.0.20" + version = "10.0.21" } dependency { groupId = "jakarta.servlet" @@ -215,7 +220,7 @@ dependency { groupId = "org.mockito" artifactId = "mockito-core" - version = "5.10.0" + version = "5.12.0" } } @@ -228,12 +233,12 @@ dependency { groupId = "org.apache.sshd" artifactId = "sshd-osgi" - version = "2.12.0" + version = "2.14.0" } dependency { groupId = "org.apache.sshd" artifactId = "sshd-sftp" - version = "2.12.0" + version = "2.14.0" } }
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/orbit-4.32.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/orbit-4.32.tpd new file mode 100644 index 0000000..480e96e --- /dev/null +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/orbit-4.32.tpd
@@ -0,0 +1,27 @@ +target "orbit-4.32" with source configurePhase +// see https://download.eclipse.org/tools/orbit/downloads/ + +location "https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2024-06" { + com.jcraft.jsch [0.1.55.v20230916-1400,0.1.55.v20230916-1400] + com.jcraft.jsch.source [0.1.55.v20230916-1400,0.1.55.v20230916-1400] + com.jcraft.jzlib [1.1.3.v20230916-1400,1.1.3.v20230916-1400] + com.jcraft.jzlib.source [1.1.3.v20230916-1400,1.1.3.v20230916-1400] + net.i2p.crypto.eddsa [0.3.0,0.3.0] + net.i2p.crypto.eddsa.source [0.3.0,0.3.0] + org.apache.ant [1.10.14.v20230922-1200,1.10.14.v20230922-1200] + org.apache.ant.source [1.10.14.v20230922-1200,1.10.14.v20230922-1200] + org.apache.httpcomponents.httpclient [4.5.14,4.5.14] + org.apache.httpcomponents.httpclient.source [4.5.14,4.5.14] + org.apache.httpcomponents.httpcore [4.4.16,4.4.16] + org.apache.httpcomponents.httpcore.source [4.4.16,4.4.16] + org.hamcrest.core [1.3.0.v20230809-1000,1.3.0.v20230809-1000] + org.hamcrest.core.source [1.3.0.v20230809-1000,1.3.0.v20230809-1000] + org.hamcrest.library [1.3.0.v20230809-1000,1.3.0.v20230809-1000] + org.hamcrest.library.source [1.3.0.v20230809-1000,1.3.0.v20230809-1000] + org.junit [4.13.2.v20230809-1000,4.13.2.v20230809-1000] + org.junit.source [4.13.2.v20230809-1000,4.13.2.v20230809-1000] + org.objenesis [3.4,3.4] + org.objenesis.source [3.4,3.4] + org.osgi.service.cm [1.6.1.202109301733,1.6.1.202109301733] + org.osgi.service.cm.source [1.6.1.202109301733,1.6.1.202109301733] +}
diff --git a/org.eclipse.jgit.packaging/pom.xml b/org.eclipse.jgit.packaging/pom.xml index 388fa6b..789963a 100644 --- a/org.eclipse.jgit.packaging/pom.xml +++ b/org.eclipse.jgit.packaging/pom.xml
@@ -16,7 +16,7 @@ <groupId>org.eclipse.jgit</groupId> <artifactId>jgit.tycho.parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> <packaging>pom</packaging> <name>JGit Tycho Parent</name> @@ -31,7 +31,7 @@ <properties> <java.version>11</java.version> <tycho-version>4.0.13</tycho-version> - <target-platform>jgit-4.21</target-platform> + <target-platform>jgit-4.32</target-platform> <project.build.outputTimestamp>${git.commit.time}</project.build.outputTimestamp> </properties> @@ -184,7 +184,7 @@ <configuration> <rules> <requireMavenVersion> - <version>3.6.3</version> + <version>3.9.0</version> </requireMavenVersion> </rules> </configuration> @@ -217,7 +217,7 @@ <plugin> <groupId>org.cyclonedx</groupId> <artifactId>cyclonedx-maven-plugin</artifactId> - <version>2.7.11</version> + <version>2.8.0</version> <configuration> <projectType>library</projectType> <schemaVersion>1.4</schemaVersion> @@ -246,7 +246,7 @@ <plugin> <groupId>io.github.git-commit-id</groupId> <artifactId>git-commit-id-maven-plugin</artifactId> - <version>7.0.0</version> + <version>8.0.2</version> <executions> <execution> <id>get-the-git-infos</id> @@ -286,7 +286,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> - <version>3.3.0</version> + <version>3.4.1</version> <configuration> <archive> <manifestEntries> @@ -399,7 +399,7 @@ <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> - <version>3.5.0</version> + <version>3.6.0</version> </plugin> <plugin> <artifactId>maven-clean-plugin</artifactId> @@ -408,22 +408,22 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> - <version>3.1.1</version> + <version>3.1.2</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-install-plugin</artifactId> - <version>3.1.1</version> + <version>3.1.2</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> - <version>4.0.0-M13</version> + <version>4.0.0-M14</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-artifact-plugin</artifactId> - <version>3.5.0</version> + <version>3.5.1</version> <configuration> <ignore>**/*cyclonedx.json</ignore> <reproducible>true</reproducible>
diff --git a/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF index 7232b27..6569af1 100644 --- a/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF
@@ -3,30 +3,30 @@ Bundle-Name: %Bundle-Name Automatic-Module-Name: org.eclipse.jgit.pgm.test Bundle-SymbolicName: org.eclipse.jgit.pgm.test -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-Vendor: %Bundle-Vendor Bundle-Localization: plugin Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-11 -Import-Package: org.eclipse.jgit.api;version="[6.9.1,6.10.0)", - org.eclipse.jgit.api.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.diff;version="[6.9.1,6.10.0)", - org.eclipse.jgit.dircache;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.diffmergetool;version="6.9.1", - org.eclipse.jgit.internal.storage.file;version="6.9.1", - org.eclipse.jgit.junit;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lib;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lib.internal;version="[6.9.1,6.10.0)", - org.eclipse.jgit.merge;version="[6.9.1,6.10.0)", - org.eclipse.jgit.pgm;version="[6.9.1,6.10.0)", - org.eclipse.jgit.pgm.internal;version="[6.9.1,6.10.0)", - org.eclipse.jgit.pgm.opt;version="[6.9.1,6.10.0)", - org.eclipse.jgit.revwalk;version="[6.9.1,6.10.0)", - org.eclipse.jgit.storage.file;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport;version="[6.9.1,6.10.0)", - org.eclipse.jgit.treewalk;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util.io;version="[6.9.1,6.10.0)", +Import-Package: org.eclipse.jgit.api;version="[6.10.2,6.11.0)", + org.eclipse.jgit.api.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.diff;version="[6.10.2,6.11.0)", + org.eclipse.jgit.dircache;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.diffmergetool;version="6.10.2", + org.eclipse.jgit.internal.storage.file;version="6.10.2", + org.eclipse.jgit.junit;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lib;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lib.internal;version="[6.10.2,6.11.0)", + org.eclipse.jgit.merge;version="[6.10.2,6.11.0)", + org.eclipse.jgit.pgm;version="[6.10.2,6.11.0)", + org.eclipse.jgit.pgm.internal;version="[6.10.2,6.11.0)", + org.eclipse.jgit.pgm.opt;version="[6.10.2,6.11.0)", + org.eclipse.jgit.revwalk;version="[6.10.2,6.11.0)", + org.eclipse.jgit.storage.file;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport;version="[6.10.2,6.11.0)", + org.eclipse.jgit.treewalk;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util.io;version="[6.10.2,6.11.0)", org.hamcrest.core;bundle-version="[1.1.0,3.0.0)", org.junit;version="[4.13,5.0.0)", org.junit.rules;version="[4.13,5.0.0)",
diff --git a/org.eclipse.jgit.pgm.test/pom.xml b/org.eclipse.jgit.pgm.test/pom.xml index ae02cdc..b950924 100644 --- a/org.eclipse.jgit.pgm.test/pom.xml +++ b/org.eclipse.jgit.pgm.test/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.pgm.test</artifactId>
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CloneTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CloneTest.java index cbb5bbb..a1fb9fb 100644 --- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CloneTest.java +++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CloneTest.java
@@ -183,7 +183,7 @@ public void testCloneBare() throws Exception { File gitDir = db.getDirectory(); String sourcePath = gitDir.getAbsolutePath(); - String targetPath = (new File(sourcePath)).getParentFile() + String targetPath = new File(sourcePath).getParentFile() .getParentFile().getAbsolutePath() + File.separator + "target.git"; String cmd = "git clone --bare " + shellQuote(sourcePath) + " " @@ -207,7 +207,7 @@ public void testCloneMirror() throws Exception { File gitDir = db.getDirectory(); String sourcePath = gitDir.getAbsolutePath(); - String targetPath = (new File(sourcePath)).getParentFile() + String targetPath = new File(sourcePath).getParentFile() .getParentFile().getAbsolutePath() + File.separator + "target.git"; String cmd = "git clone --mirror " + shellQuote(sourcePath) + " "
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ConfigTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ConfigTest.java index 005215f..0af310c 100644 --- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ConfigTest.java +++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ConfigTest.java
@@ -45,10 +45,9 @@ public void testListConfig() throws Exception { Map<String, String> options = parseOptions(output); assertEquals(!isWindows, Boolean.valueOf(options.get("core.filemode"))); - assertTrue((Boolean.valueOf(options.get("core.logallrefupdates")))); + assertTrue(Boolean.valueOf(options.get("core.logallrefupdates"))); if (isMac) { - assertTrue( - (Boolean.valueOf(options.get("core.precomposeunicode")))); + assertTrue(Boolean.valueOf(options.get("core.precomposeunicode"))); } assertEquals(Integer.valueOf(0), Integer.valueOf(options.get("core.repositoryformatversion")));
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/MergeToolTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/MergeToolTest.java index 65c7e9a..6339831 100644 --- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/MergeToolTest.java +++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/MergeToolTest.java
@@ -27,6 +27,7 @@ import org.eclipse.jgit.internal.diffmergetool.MergeTools; import org.eclipse.jgit.lib.StoredConfig; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; /** @@ -77,6 +78,7 @@ public void testUserToolWithCommandNotFoundError() throws Exception { + errorReturnCode); } + @Ignore @Test public void testEmptyToolName() throws Exception { assumeLinuxPlatform();
diff --git a/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF b/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF index 825911c..882122a 100644 --- a/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-Name: %Bundle-Name Automatic-Module-Name: org.eclipse.jgit.pgm Bundle-SymbolicName: org.eclipse.jgit.pgm -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-Vendor: %Bundle-Vendor Bundle-Localization: OSGI-INF/l10n/plugin Bundle-RequiredExecutionEnvironment: JavaSE-11 @@ -14,49 +14,49 @@ org.eclipse.jetty.servlet;version="[10.0.0,11.0.0)", org.eclipse.jetty.util;version="[10.0.0,11.0.0)", org.eclipse.jetty.util.component;version="[10.0.0,11.0.0)", - org.eclipse.jgit.api;version="[6.9.1,6.10.0)", - org.eclipse.jgit.api.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.archive;version="[6.9.1,6.10.0)", - org.eclipse.jgit.awtui;version="[6.9.1,6.10.0)", - org.eclipse.jgit.blame;version="[6.9.1,6.10.0)", - org.eclipse.jgit.diff;version="[6.9.1,6.10.0)", - org.eclipse.jgit.dircache;version="[6.9.1,6.10.0)", - org.eclipse.jgit.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.gitrepo;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.file;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.diffmergetool;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.io;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.pack;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.reftable;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lfs;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lfs.server;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lfs.server.fs;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lfs.server.s3;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lib;version="[6.9.1,6.10.0)", - org.eclipse.jgit.merge;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lib.internal;version="[6.9.1,6.10.0)", - org.eclipse.jgit.nls;version="[6.9.1,6.10.0)", - org.eclipse.jgit.notes;version="[6.9.1,6.10.0)", - org.eclipse.jgit.revplot;version="[6.9.1,6.10.0)", - org.eclipse.jgit.revwalk;version="[6.9.1,6.10.0)", - org.eclipse.jgit.revwalk.filter;version="[6.9.1,6.10.0)", - org.eclipse.jgit.storage.file;version="[6.9.1,6.10.0)", - org.eclipse.jgit.storage.pack;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport.http.apache;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport.resolver;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport.ssh.jsch;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport.sshd;version="[6.9.1,6.10.0)", - org.eclipse.jgit.treewalk;version="[6.9.1,6.10.0)", - org.eclipse.jgit.treewalk.filter;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util.io;version="[6.9.1,6.10.0)", + org.eclipse.jgit.api;version="[6.10.2,6.11.0)", + org.eclipse.jgit.api.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.archive;version="[6.10.2,6.11.0)", + org.eclipse.jgit.awtui;version="[6.10.2,6.11.0)", + org.eclipse.jgit.blame;version="[6.10.2,6.11.0)", + org.eclipse.jgit.diff;version="[6.10.2,6.11.0)", + org.eclipse.jgit.dircache;version="[6.10.2,6.11.0)", + org.eclipse.jgit.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.gitrepo;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.file;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.diffmergetool;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.io;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.pack;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.reftable;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lfs;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lfs.server;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lfs.server.fs;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lfs.server.s3;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lib;version="[6.10.2,6.11.0)", + org.eclipse.jgit.merge;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lib.internal;version="[6.10.2,6.11.0)", + org.eclipse.jgit.nls;version="[6.10.2,6.11.0)", + org.eclipse.jgit.notes;version="[6.10.2,6.11.0)", + org.eclipse.jgit.revplot;version="[6.10.2,6.11.0)", + org.eclipse.jgit.revwalk;version="[6.10.2,6.11.0)", + org.eclipse.jgit.revwalk.filter;version="[6.10.2,6.11.0)", + org.eclipse.jgit.storage.file;version="[6.10.2,6.11.0)", + org.eclipse.jgit.storage.pack;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport.http.apache;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport.resolver;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport.ssh.jsch;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport.sshd;version="[6.10.2,6.11.0)", + org.eclipse.jgit.treewalk;version="[6.10.2,6.11.0)", + org.eclipse.jgit.treewalk.filter;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util.io;version="[6.10.2,6.11.0)", org.kohsuke.args4j;version="[2.33.0,3.0.0)", org.kohsuke.args4j.spi;version="[2.33.0,3.0.0)" -Export-Package: org.eclipse.jgit.console;version="6.9.1"; +Export-Package: org.eclipse.jgit.console;version="6.10.2"; uses:="org.eclipse.jgit.transport, org.eclipse.jgit.util", - org.eclipse.jgit.pgm;version="6.9.1"; + org.eclipse.jgit.pgm;version="6.10.2"; uses:="org.eclipse.jgit.transport, org.eclipse.jgit.util.io, org.eclipse.jgit.awtui, @@ -68,14 +68,14 @@ org.eclipse.jgit.treewalk, org.eclipse.jgit.api, javax.swing", - org.eclipse.jgit.pgm.debug;version="6.9.1"; + org.eclipse.jgit.pgm.debug;version="6.10.2"; uses:="org.eclipse.jgit.util.io, org.eclipse.jgit.pgm, org.eclipse.jetty.servlet", - org.eclipse.jgit.pgm.internal;version="6.9.1"; + org.eclipse.jgit.pgm.internal;version="6.10.2"; x-friends:="org.eclipse.jgit.pgm.test, org.eclipse.jgit.test", - org.eclipse.jgit.pgm.opt;version="6.9.1"; + org.eclipse.jgit.pgm.opt;version="6.10.2"; uses:="org.kohsuke.args4j, org.eclipse.jgit.lib, org.eclipse.jgit.revwalk,
diff --git a/org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF index cb5e814..78e2979 100644 --- a/org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF
@@ -3,5 +3,5 @@ Bundle-Name: org.eclipse.jgit.pgm - Sources Bundle-SymbolicName: org.eclipse.jgit.pgm.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 6.9.1.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.pgm;version="6.9.1.qualifier";roots="." +Bundle-Version: 6.10.2.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.pgm;version="6.10.2.qualifier";roots="."
diff --git a/org.eclipse.jgit.pgm/pom.xml b/org.eclipse.jgit.pgm/pom.xml index 488b481..0bc4d7e 100644 --- a/org.eclipse.jgit.pgm/pom.xml +++ b/org.eclipse.jgit.pgm/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.pgm</artifactId>
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java index 210e172..2a9f7ac 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java
@@ -19,10 +19,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.Enumeration; import java.util.HashMap; import java.util.Map; -import java.util.Vector; /** * List of all commands known by jgit's command line tools. @@ -104,7 +104,7 @@ private Enumeration<URL> catalogs() { final String pfx = "META-INF/services/"; //$NON-NLS-1$ return ldr.getResources(pfx + TextBuiltin.class.getName()); } catch (IOException err) { - return new Vector<URL>().elements(); + return Collections.emptyEnumeration(); } }
diff --git a/org.eclipse.jgit.ssh.apache.agent/META-INF/MANIFEST.MF b/org.eclipse.jgit.ssh.apache.agent/META-INF/MANIFEST.MF index 5011a8e..9536488 100644 --- a/org.eclipse.jgit.ssh.apache.agent/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.ssh.apache.agent/META-INF/MANIFEST.MF
@@ -2,16 +2,16 @@ Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.eclipse.jgit.ssh.apache.agent;singleton:=true -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-Localization: OSGI-INF/l10n/agent Bundle-Vendor: %Bundle-Vendor -Fragment-Host: org.eclipse.jgit.ssh.apache;bundle-version="[6.9.1,6.10.0)" +Fragment-Host: org.eclipse.jgit.ssh.apache;bundle-version="[6.10.2,6.11.0)" Bundle-ActivationPolicy: lazy Automatic-Module-Name: org.eclipse.jgit.ssh.apache.agent Bundle-RequiredExecutionEnvironment: JavaSE-11 -Import-Package: org.eclipse.jgit.transport.sshd;version="[6.9.1,6.10.0)", - org.eclipse.jgit.nls;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util;version="[6.9.1,6.10.0)" +Import-Package: org.eclipse.jgit.transport.sshd;version="[6.10.2,6.11.0)", + org.eclipse.jgit.nls;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util;version="[6.10.2,6.11.0)" Require-Bundle: com.sun.jna;bundle-version="[5.8.0,6.0.0)", com.sun.jna.platform;bundle-version="[5.8.0,6.0.0)" -Export-Package: org.eclipse.jgit.internal.transport.sshd.agent.connector;version="6.9.1";x-internal:=true +Export-Package: org.eclipse.jgit.internal.transport.sshd.agent.connector;version="6.10.2";x-internal:=true
diff --git a/org.eclipse.jgit.ssh.apache.agent/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.ssh.apache.agent/META-INF/SOURCE-MANIFEST.MF index e841539..89faf86 100644 --- a/org.eclipse.jgit.ssh.apache.agent/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.ssh.apache.agent/META-INF/SOURCE-MANIFEST.MF
@@ -3,5 +3,5 @@ Bundle-Name: org.eclipse.jgit.ssh.apache.agent - Sources Bundle-SymbolicName: org.eclipse.jgit.ssh.apache.agent.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 6.9.1.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.ssh.apache.agent;version="6.9.1.qualifier";roots="." +Bundle-Version: 6.10.2.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.ssh.apache.agent;version="6.10.2.qualifier";roots="."
diff --git a/org.eclipse.jgit.ssh.apache.agent/pom.xml b/org.eclipse.jgit.ssh.apache.agent/pom.xml index 7da173a..f940edd 100644 --- a/org.eclipse.jgit.ssh.apache.agent/pom.xml +++ b/org.eclipse.jgit.ssh.apache.agent/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.ssh.apache.agent</artifactId>
diff --git a/org.eclipse.jgit.ssh.apache.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.ssh.apache.test/META-INF/MANIFEST.MF index 7c5b2d7..9502803 100644 --- a/org.eclipse.jgit.ssh.apache.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.ssh.apache.test/META-INF/MANIFEST.MF
@@ -3,35 +3,36 @@ Bundle-Name: %Bundle-Name Automatic-Module-Name: org.eclipse.jgit.ssh.apache.test Bundle-SymbolicName: org.eclipse.jgit.ssh.apache.test -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-Vendor: %Bundle-Vendor Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.hamcrest.core;bundle-version="[1.3.0,2.0.0)" -Import-Package: org.apache.sshd.client.config.hosts;version="[2.12.0,2.13.0)", - org.apache.sshd.common;version="[2.12.0,2.13.0)", - org.apache.sshd.common.auth;version="[2.12.0,2.13.0)", - org.apache.sshd.common.config.keys;version="[2.12.0,2.13.0)", - org.apache.sshd.common.helpers;version="[2.12.0,2.13.0)", - org.apache.sshd.common.kex;version="[2.12.0,2.13.0)", - org.apache.sshd.common.keyprovider;version="[2.12.0,2.13.0)", - org.apache.sshd.common.session;version="[2.12.0,2.13.0)", - org.apache.sshd.common.signature;version="[2.12.0,2.13.0)", - org.apache.sshd.common.util.net;version="[2.12.0,2.13.0)", - org.apache.sshd.common.util.security;version="[2.12.0,2.13.0)", - org.apache.sshd.core;version="[2.12.0,2.13.0)", - org.apache.sshd.server;version="[2.12.0,2.13.0)", - org.apache.sshd.server.forward;version="[2.12.0,2.13.0)", - org.eclipse.jgit.api;version="[6.9.1,6.10.0)", - org.eclipse.jgit.api.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.transport.sshd.proxy;version="[6.9.1,6.10.0)", - org.eclipse.jgit.junit;version="[6.9.1,6.10.0)", - org.eclipse.jgit.junit.ssh;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lib;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport.sshd;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport.sshd.agent;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util;version="[6.9.1,6.10.0)", +Import-Package: org.apache.sshd.client.config.hosts;version="[2.14.0,2.15.0)", + org.apache.sshd.common;version="[2.14.0,2.15.0)", + org.apache.sshd.common.auth;version="[2.14.0,2.15.0)", + org.apache.sshd.common.config.keys;version="[2.14.0,2.15.0)", + org.apache.sshd.common.helpers;version="[2.14.0,2.15.0)", + org.apache.sshd.common.kex;version="[2.14.0,2.15.0)", + org.apache.sshd.common.keyprovider;version="[2.14.0,2.15.0)", + org.apache.sshd.common.session;version="[2.14.0,2.15.0)", + org.apache.sshd.common.signature;version="[2.14.0,2.15.0)", + org.apache.sshd.common.util.net;version="[2.14.0,2.15.0)", + org.apache.sshd.common.util.security;version="[2.14.0,2.15.0)", + org.apache.sshd.core;version="[2.14.0,2.15.0)", + org.apache.sshd.server;version="[2.14.0,2.15.0)", + org.apache.sshd.server.forward;version="[2.14.0,2.15.0)", + org.eclipse.jgit.api;version="[6.10.2,6.11.0)", + org.eclipse.jgit.api.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.file;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.transport.sshd.proxy;version="[6.10.2,6.11.0)", + org.eclipse.jgit.junit;version="[6.10.2,6.11.0)", + org.eclipse.jgit.junit.ssh;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lib;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport.sshd;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport.sshd.agent;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util;version="[6.10.2,6.11.0)", org.junit;version="[4.13,5.0.0)", org.junit.experimental.theories;version="[4.13,5.0.0)", org.junit.runner;version="[4.13,5.0.0)"
diff --git a/org.eclipse.jgit.ssh.apache.test/pom.xml b/org.eclipse.jgit.ssh.apache.test/pom.xml index a8598a9..009af2d 100644 --- a/org.eclipse.jgit.ssh.apache.test/pom.xml +++ b/org.eclipse.jgit.ssh.apache.test/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.ssh.apache.test</artifactId>
diff --git a/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/ApacheSshProtocol2Test.java b/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/ApacheSshProtocol2Test.java index eef0402..69bd5c5 100644 --- a/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/ApacheSshProtocol2Test.java +++ b/org.eclipse.jgit.ssh.apache.test/tst/org/eclipse/jgit/transport/sshd/ApacheSshProtocol2Test.java
@@ -17,7 +17,6 @@ import org.eclipse.jgit.junit.ssh.SshBasicTestBase; import org.eclipse.jgit.lib.Constants; -import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.StoredConfig; import org.eclipse.jgit.transport.SshSessionFactory; import org.eclipse.jgit.util.FS; @@ -52,7 +51,8 @@ protected void installConfig(String... config) { @Override public void setUp() throws Exception { super.setUp(); - StoredConfig config = ((Repository) db).getConfig(); + @SuppressWarnings("restriction") + StoredConfig config = db.getConfig(); config.setInt("protocol", null, "version", 2); config.save(); }
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 a8fcca7..8739457 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
@@ -861,4 +861,37 @@ public void testAuthFailureMessage() throws Exception { verifyAuthLog(e.getMessage(), "log in"); } + @Test + public void testCipherModificationSingle() throws Exception { + cloneWith( + "ssh://" + TEST_USER + "@localhost:" + testPort + + "/doesntmatter", + defaultCloneDir, null, + "IdentityFile " + privateKey1.getAbsolutePath(), + "Ciphers aes192-ctr"); + } + + @Test + public void testCipherModificationAdd() throws Exception { + cloneWith( + "ssh://" + TEST_USER + "@localhost:" + testPort + + "/doesntmatter", + defaultCloneDir, null, + "IdentityFile " + privateKey1.getAbsolutePath(), + "Ciphers +3des-cbc"); + } + + @Test + public void testCipherModificationUnknown() throws Exception { + TransportException e = assertThrows(TransportException.class, + () -> cloneWith( + "ssh://" + TEST_USER + "@localhost:" + testPort + + "/doesntmatter", + defaultCloneDir, null, + "IdentityFile " + privateKey1.getAbsolutePath(), + // The server is not configured to use this deprecated + // algorithm + "Ciphers 3des-cbc")); + assertTrue(e.getLocalizedMessage().contains("3des-cbc")); + } }
diff --git a/org.eclipse.jgit.ssh.apache/META-INF/MANIFEST.MF b/org.eclipse.jgit.ssh.apache/META-INF/MANIFEST.MF index ac9d964..cff6235 100644 --- a/org.eclipse.jgit.ssh.apache/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.ssh.apache/META-INF/MANIFEST.MF
@@ -6,9 +6,9 @@ Bundle-Vendor: %Bundle-Vendor Bundle-Localization: OSGI-INF/l10n/plugin Bundle-ActivationPolicy: lazy -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-11 -Export-Package: org.eclipse.jgit.internal.transport.sshd;version="6.9.1";x-internal:=true; +Export-Package: org.eclipse.jgit.internal.transport.sshd;version="6.10.2";x-internal:=true; uses:="org.apache.sshd.client, org.apache.sshd.client.auth, org.apache.sshd.client.auth.keyboard, @@ -23,77 +23,78 @@ org.apache.sshd.common.signature, org.apache.sshd.common.util.buffer, org.eclipse.jgit.transport", - org.eclipse.jgit.internal.transport.sshd.agent;version="6.9.1";x-internal:=true, - org.eclipse.jgit.internal.transport.sshd.auth;version="6.9.1";x-internal:=true, - org.eclipse.jgit.internal.transport.sshd.pkcs11;version="6.9.1";x-internal:=true, - org.eclipse.jgit.internal.transport.sshd.proxy;version="6.9.1";x-friends:="org.eclipse.jgit.ssh.apache.test", - org.eclipse.jgit.transport.sshd;version="6.9.1"; + org.eclipse.jgit.internal.transport.sshd.agent;version="6.10.2";x-internal:=true, + org.eclipse.jgit.internal.transport.sshd.auth;version="6.10.2";x-internal:=true, + org.eclipse.jgit.internal.transport.sshd.pkcs11;version="6.10.2";x-internal:=true, + org.eclipse.jgit.internal.transport.sshd.proxy;version="6.10.2";x-friends:="org.eclipse.jgit.ssh.apache.test", + org.eclipse.jgit.transport.sshd;version="6.10.2"; uses:="org.eclipse.jgit.transport, org.apache.sshd.client.config.hosts, org.apache.sshd.common.keyprovider, org.eclipse.jgit.util, org.apache.sshd.client.session, org.apache.sshd.client.keyverifier", - org.eclipse.jgit.transport.sshd.agent;version="6.9.1", + org.eclipse.jgit.transport.sshd.agent;version="6.10.2", sun.security.x509 Import-Package: net.i2p.crypto.eddsa;version="[0.3.0,0.4.0)", - org.apache.sshd.agent;version="[2.12.0,2.13.0)", - org.apache.sshd.client;version="[2.12.0,2.13.0)", - org.apache.sshd.client.auth;version="[2.12.0,2.13.0)", - org.apache.sshd.client.auth.keyboard;version="[2.12.0,2.13.0)", - org.apache.sshd.client.auth.password;version="[2.12.0,2.13.0)", - org.apache.sshd.client.auth.pubkey;version="[2.12.0,2.13.0)", - org.apache.sshd.client.channel;version="[2.12.0,2.13.0)", - org.apache.sshd.client.config.hosts;version="[2.12.0,2.13.0)", - org.apache.sshd.client.config.keys;version="[2.12.0,2.13.0)", - org.apache.sshd.client.future;version="[2.12.0,2.13.0)", - org.apache.sshd.client.keyverifier;version="[2.12.0,2.13.0)", - org.apache.sshd.client.session;version="[2.12.0,2.13.0)", - org.apache.sshd.client.session.forward;version="[2.12.0,2.13.0)", - org.apache.sshd.common;version="[2.12.0,2.13.0)", - org.apache.sshd.common.auth;version="[2.12.0,2.13.0)", - org.apache.sshd.common.channel;version="[2.12.0,2.13.0)", - org.apache.sshd.common.compression;version="[2.12.0,2.13.0)", - org.apache.sshd.common.config.keys;version="[2.12.0,2.13.0)", - org.apache.sshd.common.config.keys.loader;version="[2.12.0,2.13.0)", - org.apache.sshd.common.config.keys.loader.openssh.kdf;version="[2.12.0,2.13.0)", - org.apache.sshd.common.config.keys.u2f;version="[2.12.0,2.13.0)", - org.apache.sshd.common.digest;version="[2.12.0,2.13.0)", - org.apache.sshd.common.forward;version="[2.12.0,2.13.0)", - org.apache.sshd.common.future;version="[2.12.0,2.13.0)", - org.apache.sshd.common.helpers;version="[2.12.0,2.13.0)", - org.apache.sshd.common.io;version="[2.12.0,2.13.0)", - org.apache.sshd.common.kex;version="[2.12.0,2.13.0)", - org.apache.sshd.common.kex.extension;version="[2.12.0,2.13.0)", - org.apache.sshd.common.kex.extension.parser;version="[2.12.0,2.13.0)", - org.apache.sshd.common.keyprovider;version="[2.12.0,2.13.0)", - org.apache.sshd.common.mac;version="[2.12.0,2.13.0)", - org.apache.sshd.common.random;version="[2.12.0,2.13.0)", - org.apache.sshd.common.session;version="[2.12.0,2.13.0)", - org.apache.sshd.common.session.helpers;version="[2.12.0,2.13.0)", - org.apache.sshd.common.signature;version="[2.12.0,2.13.0)", - org.apache.sshd.common.util;version="[2.12.0,2.13.0)", - org.apache.sshd.common.util.buffer;version="[2.12.0,2.13.0)", - org.apache.sshd.common.util.buffer.keys;version="[2.12.0,2.13.0)", - org.apache.sshd.common.util.closeable;version="[2.12.0,2.13.0)", - org.apache.sshd.common.util.io;version="[2.12.0,2.13.0)", - org.apache.sshd.common.util.io.der;version="[2.12.0,2.13.0)", - org.apache.sshd.common.util.io.functors;version="[2.12.0,2.13.0)", - org.apache.sshd.common.util.io.resource;version="[2.12.0,2.13.0)", - org.apache.sshd.common.util.logging;version="[2.12.0,2.13.0)", - org.apache.sshd.common.util.net;version="[2.12.0,2.13.0)", - org.apache.sshd.common.util.security;version="[2.12.0,2.13.0)", - org.apache.sshd.core;version="[2.12.0,2.13.0)", - org.apache.sshd.server.auth;version="[2.12.0,2.13.0)", - org.apache.sshd.sftp;version="[2.12.0,2.13.0)", - org.apache.sshd.sftp.client;version="[2.12.0,2.13.0)", - org.apache.sshd.sftp.common;version="[2.12.0,2.13.0)", - org.eclipse.jgit.annotations;version="[6.9.1,6.10.0)", - org.eclipse.jgit.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.fnmatch;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.file;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.transport.ssh;version="[6.9.1,6.10.0)", - org.eclipse.jgit.nls;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util;version="[6.9.1,6.10.0)", + org.apache.sshd.agent;version="[2.14.0,2.15.0)", + org.apache.sshd.client;version="[2.14.0,2.15.0)", + org.apache.sshd.client.auth;version="[2.14.0,2.15.0)", + org.apache.sshd.client.auth.keyboard;version="[2.14.0,2.15.0)", + org.apache.sshd.client.auth.password;version="[2.14.0,2.15.0)", + org.apache.sshd.client.auth.pubkey;version="[2.14.0,2.15.0)", + org.apache.sshd.client.channel;version="[2.14.0,2.15.0)", + org.apache.sshd.client.config.hosts;version="[2.14.0,2.15.0)", + org.apache.sshd.client.config.keys;version="[2.14.0,2.15.0)", + org.apache.sshd.client.future;version="[2.14.0,2.15.0)", + org.apache.sshd.client.keyverifier;version="[2.14.0,2.15.0)", + org.apache.sshd.client.session;version="[2.14.0,2.15.0)", + org.apache.sshd.client.session.forward;version="[2.14.0,2.15.0)", + org.apache.sshd.common;version="[2.14.0,2.15.0)", + org.apache.sshd.common.auth;version="[2.14.0,2.15.0)", + org.apache.sshd.common.channel;version="[2.14.0,2.15.0)", + org.apache.sshd.common.cipher;version="[2.14.0,2.15.0)", + org.apache.sshd.common.compression;version="[2.14.0,2.15.0)", + org.apache.sshd.common.config.keys;version="[2.14.0,2.15.0)", + org.apache.sshd.common.config.keys.loader;version="[2.14.0,2.15.0)", + org.apache.sshd.common.config.keys.loader.openssh.kdf;version="[2.14.0,2.15.0)", + org.apache.sshd.common.config.keys.u2f;version="[2.14.0,2.15.0)", + org.apache.sshd.common.digest;version="[2.14.0,2.15.0)", + org.apache.sshd.common.forward;version="[2.14.0,2.15.0)", + org.apache.sshd.common.future;version="[2.14.0,2.15.0)", + org.apache.sshd.common.helpers;version="[2.14.0,2.15.0)", + org.apache.sshd.common.io;version="[2.14.0,2.15.0)", + org.apache.sshd.common.kex;version="[2.14.0,2.15.0)", + org.apache.sshd.common.kex.extension;version="[2.14.0,2.15.0)", + org.apache.sshd.common.kex.extension.parser;version="[2.14.0,2.15.0)", + org.apache.sshd.common.keyprovider;version="[2.14.0,2.15.0)", + org.apache.sshd.common.mac;version="[2.14.0,2.15.0)", + org.apache.sshd.common.random;version="[2.14.0,2.15.0)", + org.apache.sshd.common.session;version="[2.14.0,2.15.0)", + org.apache.sshd.common.session.helpers;version="[2.14.0,2.15.0)", + org.apache.sshd.common.signature;version="[2.14.0,2.15.0)", + org.apache.sshd.common.util;version="[2.14.0,2.15.0)", + org.apache.sshd.common.util.buffer;version="[2.14.0,2.15.0)", + org.apache.sshd.common.util.buffer.keys;version="[2.14.0,2.15.0)", + org.apache.sshd.common.util.closeable;version="[2.14.0,2.15.0)", + org.apache.sshd.common.util.io;version="[2.14.0,2.15.0)", + org.apache.sshd.common.util.io.der;version="[2.14.0,2.15.0)", + org.apache.sshd.common.util.io.functors;version="[2.14.0,2.15.0)", + org.apache.sshd.common.util.io.resource;version="[2.14.0,2.15.0)", + org.apache.sshd.common.util.logging;version="[2.14.0,2.15.0)", + org.apache.sshd.common.util.net;version="[2.14.0,2.15.0)", + org.apache.sshd.common.util.security;version="[2.14.0,2.15.0)", + org.apache.sshd.core;version="[2.14.0,2.15.0)", + org.apache.sshd.server.auth;version="[2.14.0,2.15.0)", + org.apache.sshd.sftp;version="[2.14.0,2.15.0)", + org.apache.sshd.sftp.client;version="[2.14.0,2.15.0)", + org.apache.sshd.sftp.common;version="[2.14.0,2.15.0)", + org.eclipse.jgit.annotations;version="[6.10.2,6.11.0)", + org.eclipse.jgit.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.fnmatch;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.file;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.transport.ssh;version="[6.10.2,6.11.0)", + org.eclipse.jgit.nls;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util;version="[6.10.2,6.11.0)", org.slf4j;version="[1.7.0,3.0.0)"
diff --git a/org.eclipse.jgit.ssh.apache/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.ssh.apache/META-INF/SOURCE-MANIFEST.MF index 5e7a06c..b237d0e 100644 --- a/org.eclipse.jgit.ssh.apache/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.ssh.apache/META-INF/SOURCE-MANIFEST.MF
@@ -3,5 +3,5 @@ Bundle-Name: org.eclipse.jgit.ssh.apache - Sources Bundle-SymbolicName: org.eclipse.jgit.ssh.apache.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 6.9.1.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.ssh.apache;version="6.9.1.qualifier";roots="." +Bundle-Version: 6.10.2.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.ssh.apache;version="6.10.2.qualifier";roots="."
diff --git a/org.eclipse.jgit.ssh.apache/pom.xml b/org.eclipse.jgit.ssh.apache/pom.xml index 68b2360..63b36de 100644 --- a/org.eclipse.jgit.ssh.apache/pom.xml +++ b/org.eclipse.jgit.ssh.apache/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.ssh.apache</artifactId>
diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitClientSession.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitClientSession.java index c19a04d..32d6fac 100644 --- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitClientSession.java +++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitClientSession.java
@@ -20,6 +20,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.EnumSet; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashSet; @@ -28,6 +29,7 @@ import java.util.Objects; import java.util.Set; import java.util.function.Supplier; +import java.util.stream.Collectors; import org.apache.sshd.client.ClientBuilder; import org.apache.sshd.client.ClientFactoryManager; @@ -36,8 +38,12 @@ import org.apache.sshd.client.session.ClientSessionImpl; import org.apache.sshd.common.AttributeRepository; import org.apache.sshd.common.FactoryManager; +import org.apache.sshd.common.NamedFactory; import org.apache.sshd.common.NamedResource; import org.apache.sshd.common.PropertyResolver; +import org.apache.sshd.common.cipher.BuiltinCiphers; +import org.apache.sshd.common.cipher.Cipher; +import org.apache.sshd.common.cipher.CipherFactory; import org.apache.sshd.common.config.keys.KeyUtils; import org.apache.sshd.common.io.IoSession; import org.apache.sshd.common.io.IoWriteFuture; @@ -86,12 +92,21 @@ public class JGitClientSession extends ClientSessionImpl { */ private static final int DEFAULT_MAX_IDENTIFICATION_SIZE = 64 * 1024; - private static final AttributeKey<Boolean> INITIAL_KEX_DONE = new AttributeKey<>(); + /** + * Cipher implementations that we never ever want to use, even if Apache + * MINA SSHD has implementations for them. + */ + private static final Set<? extends CipherFactory> FORBIDDEN_CIPHERS = EnumSet + .of(BuiltinCiphers.none); private HostConfigEntry hostConfig; private CredentialsProvider credentialsProvider; + private boolean isInitialKex = true; + + private List<NamedFactory<Cipher>> ciphers; + private volatile StatefulProxyConnector proxyHandler; /** @@ -349,8 +364,7 @@ private List<String> determineKexProposal() { protected String resolveSessionKexProposal(String hostKeyTypes) throws IOException { String kexMethods = String.join(",", determineKexProposal()); //$NON-NLS-1$ - Boolean isRekey = getAttribute(INITIAL_KEX_DONE); - if (isRekey == null || !isRekey.booleanValue()) { + if (isInitialKex) { // First time KexExtensionHandler extHandler = getKexExtensionHandler(); if (extHandler != null && extHandler.isKexExtensionsAvailable(this, @@ -361,7 +375,7 @@ protected String resolveSessionKexProposal(String hostKeyTypes) kexMethods += ',' + KexExtensions.CLIENT_KEX_EXTENSION; } } - setAttribute(INITIAL_KEX_DONE, Boolean.TRUE); + isInitialKex = false; } if (log.isDebugEnabled()) { log.debug(SshConstants.KEX_ALGORITHMS + ' ' + kexMethods); @@ -369,6 +383,46 @@ protected String resolveSessionKexProposal(String hostKeyTypes) return kexMethods; } + @Override + public List<NamedFactory<Cipher>> getCipherFactories() { + if (ciphers == null) { + List<NamedFactory<Cipher>> defaultCiphers = super.getCipherFactories(); + HostConfigEntry config = resolveAttribute( + JGitSshClient.HOST_CONFIG_ENTRY); + String algorithms = config.getProperty(SshConstants.CIPHERS); + if (!StringUtils.isEmptyOrNull(algorithms)) { + List<String> defaultCipherNames = defaultCiphers + .stream().map(NamedFactory::getName) + .collect(Collectors.toCollection(ArrayList::new)); + Set<String> allKnownCiphers = new HashSet<>(); + BuiltinCiphers.VALUES.stream() + .filter(c -> !FORBIDDEN_CIPHERS.contains(c)) + .filter(CipherFactory::isSupported) + .forEach(c -> allKnownCiphers.add(c.getName())); + BuiltinCiphers.getRegisteredExtensions().stream() + .filter(CipherFactory::isSupported) + .forEach(c -> allKnownCiphers.add(c.getName())); + List<String> sessionCipherNames = modifyAlgorithmList( + defaultCipherNames, allKnownCiphers, algorithms, + SshConstants.CIPHERS); + if (sessionCipherNames.isEmpty()) { + log.warn(format(SshdText.get().configNoKnownAlgorithms, + SshConstants.CIPHERS, algorithms)); + ciphers = defaultCiphers; + } else { + List<NamedFactory<Cipher>> sessionCiphers = new ArrayList<>( + sessionCipherNames.size()); + sessionCipherNames.forEach(name -> sessionCiphers + .add(BuiltinCiphers.resolveFactory(name))); + ciphers = sessionCiphers; + } + } else { + ciphers = defaultCiphers; + } + } + return ciphers; + } + /** * Modifies a given algorithm list according to a list from the ssh config, * including add ('+'), remove ('-') and reordering ('^') operators.
diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitPublicKeyAuthentication.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitPublicKeyAuthentication.java index b0b1028..6aace47 100644 --- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitPublicKeyAuthentication.java +++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitPublicKeyAuthentication.java
@@ -17,6 +17,7 @@ import java.io.File; import java.io.IOException; +import java.io.StreamCorruptedException; import java.net.URISyntaxException; import java.nio.file.Files; import java.nio.file.InvalidPathException; @@ -355,20 +356,20 @@ private PublicKey readPublicKey(String keyFile, boolean isDerived) { // only warn about non-existing files in case the key file is // not derived if (!isDerived) { - log.warn("{}", //$NON-NLS-1$ + log.warn(LOG_FORMAT, format(SshdText.get().cannotReadPublicKey, keyFile)); } - } catch (InvalidPathException | IOException e) { - log.warn("{}", //$NON-NLS-1$ - format(SshdText.get().cannotReadPublicKey, keyFile), e); - } catch (GeneralSecurityException e) { + } catch (GeneralSecurityException | StreamCorruptedException e) { // ignore in case this is not a derived key path, as in most // cases this specifies a private key if (isDerived) { - log.warn("{}", //$NON-NLS-1$ + log.warn(LOG_FORMAT, format(SshdText.get().cannotReadPublicKey, keyFile), e); } + } catch (InvalidPathException | IOException e) { + log.warn(LOG_FORMAT, + format(SshdText.get().cannotReadPublicKey, keyFile), e); } return null; }
diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/KnownHostEntryReader.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/KnownHostEntryReader.java index a00e5d9..96829b7 100644 --- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/KnownHostEntryReader.java +++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/KnownHostEntryReader.java
@@ -18,9 +18,9 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.LinkedList; import java.util.List; import java.util.stream.Collectors; @@ -65,7 +65,7 @@ private KnownHostEntryReader() { */ public static List<KnownHostEntry> readFromFile(Path path) throws IOException { - List<KnownHostEntry> result = new LinkedList<>(); + List<KnownHostEntry> result = new ArrayList<>(); try (BufferedReader r = Files.newBufferedReader(path, UTF_8)) { r.lines().forEachOrdered(l -> { if (l == null) {
diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/OpenSshServerKeyDatabase.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/OpenSshServerKeyDatabase.java index 65ba5be..2b4f7e5 100644 --- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/OpenSshServerKeyDatabase.java +++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/OpenSshServerKeyDatabase.java
@@ -31,7 +31,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Random; @@ -587,7 +586,7 @@ private List<HostEntryPair> reload(Path path) throws IOException { if (rawEntries == null || rawEntries.isEmpty()) { return Collections.emptyList(); } - List<HostEntryPair> newEntries = new LinkedList<>(); + List<HostEntryPair> newEntries = new ArrayList<>(); for (KnownHostEntry entry : rawEntries) { AuthorizedKeyEntry keyPart = entry.getKeyEntry(); if (keyPart == null) {
diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/SshdSession.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/SshdSession.java index b94ccc6..96316ba 100644 --- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/SshdSession.java +++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/SshdSession.java
@@ -23,7 +23,6 @@ import java.util.Collection; import java.util.Collections; import java.util.EnumSet; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.concurrent.CopyOnWriteArrayList; @@ -263,7 +262,7 @@ private List<URIish> determineHops(List<URIish> currentHops, private List<URIish> parseProxyJump(String proxyJump) throws URISyntaxException { String[] hops = proxyJump.split(","); //$NON-NLS-1$ - List<URIish> result = new LinkedList<>(); + List<URIish> result = new ArrayList<>(); for (String hop : hops) { // There shouldn't be any whitespace, but let's be lenient hop = hop.trim();
diff --git a/org.eclipse.jgit.ssh.jsch.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.ssh.jsch.test/META-INF/MANIFEST.MF index 1af338b..2f2d6b8 100644 --- a/org.eclipse.jgit.ssh.jsch.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.ssh.jsch.test/META-INF/MANIFEST.MF
@@ -3,19 +3,20 @@ Bundle-Name: %Bundle-Name Automatic-Module-Name: org.eclipse.jgit.ssh.jsch.test Bundle-SymbolicName: org.eclipse.jgit.ssh.jsch.test -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-Vendor: %Bundle-Vendor Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.hamcrest.core;bundle-version="[1.3.0,2.0.0)" Import-Package: com.jcraft.jsch;version="[0.1.54,0.2.0)", - org.eclipse.jgit.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.junit;version="[6.9.1,6.10.0)", - org.eclipse.jgit.junit.ssh;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lib;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport.ssh.jsch;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util;version="[6.9.1,6.10.0)", + org.eclipse.jgit.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.file;version="[6.10.2,6.11.0)", + org.eclipse.jgit.junit;version="[6.10.2,6.11.0)", + org.eclipse.jgit.junit.ssh;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lib;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport.ssh.jsch;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util;version="[6.10.2,6.11.0)", org.junit;version="[4.13,5.0.0)", org.junit.experimental.theories;version="[4.13,5.0.0)", org.junit.runner;version="[4.13,5.0.0)"
diff --git a/org.eclipse.jgit.ssh.jsch.test/pom.xml b/org.eclipse.jgit.ssh.jsch.test/pom.xml index d70dc12..0241204 100644 --- a/org.eclipse.jgit.ssh.jsch.test/pom.xml +++ b/org.eclipse.jgit.ssh.jsch.test/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.ssh.jsch.test</artifactId>
diff --git a/org.eclipse.jgit.ssh.jsch.test/tst/org/eclipse/jgit/transport/ssh/jsch/JSchSshProtocol2Test.java b/org.eclipse.jgit.ssh.jsch.test/tst/org/eclipse/jgit/transport/ssh/jsch/JSchSshProtocol2Test.java index 611d4e8..8aa33e3 100644 --- a/org.eclipse.jgit.ssh.jsch.test/tst/org/eclipse/jgit/transport/ssh/jsch/JSchSshProtocol2Test.java +++ b/org.eclipse.jgit.ssh.jsch.test/tst/org/eclipse/jgit/transport/ssh/jsch/JSchSshProtocol2Test.java
@@ -22,7 +22,6 @@ import org.eclipse.jgit.errors.TransportException; import org.eclipse.jgit.junit.ssh.SshBasicTestBase; import org.eclipse.jgit.lib.Constants; -import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.StoredConfig; import org.eclipse.jgit.transport.CredentialsProvider; import org.eclipse.jgit.transport.RemoteSession; @@ -89,7 +88,8 @@ private OpenSshConfig createConfig(String... content) throws IOException { @Override public void setUp() throws Exception { super.setUp(); - StoredConfig config = ((Repository) db).getConfig(); + @SuppressWarnings("restriction") + StoredConfig config = db.getConfig(); config.setInt("protocol", null, "version", 2); config.save(); }
diff --git a/org.eclipse.jgit.ssh.jsch/META-INF/MANIFEST.MF b/org.eclipse.jgit.ssh.jsch/META-INF/MANIFEST.MF index 36e2de2..aad3c29 100644 --- a/org.eclipse.jgit.ssh.jsch/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.ssh.jsch/META-INF/MANIFEST.MF
@@ -3,19 +3,19 @@ Bundle-Name: %Bundle-Name Automatic-Module-Name: org.eclipse.jgit.ssh.jsch Bundle-SymbolicName: org.eclipse.jgit.ssh.jsch;singleton:=true -Fragment-Host: org.eclipse.jgit;bundle-version="[6.9.1,6.10.0)" +Fragment-Host: org.eclipse.jgit;bundle-version="[6.10.2,6.11.0)" Bundle-Vendor: %Bundle-Vendor Bundle-Localization: OSGI-INF/l10n/jsch Bundle-ActivationPolicy: lazy -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-11 -Export-Package: org.eclipse.jgit.transport.ssh.jsch;version="6.9.1" +Export-Package: org.eclipse.jgit.transport.ssh.jsch;version="6.10.2" Import-Package: com.jcraft.jsch;version="[0.1.37,0.2.0)", - org.eclipse.jgit.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.transport.ssh;version="[6.9.1,6.10.0)", - org.eclipse.jgit.nls;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util.io;version="[6.9.1,6.10.0)", + org.eclipse.jgit.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.transport.ssh;version="[6.10.2,6.11.0)", + org.eclipse.jgit.nls;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util.io;version="[6.10.2,6.11.0)", org.slf4j;version="[1.7.0,3.0.0)"
diff --git a/org.eclipse.jgit.ssh.jsch/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.ssh.jsch/META-INF/SOURCE-MANIFEST.MF index 50747f6..883cbdf 100644 --- a/org.eclipse.jgit.ssh.jsch/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.ssh.jsch/META-INF/SOURCE-MANIFEST.MF
@@ -3,5 +3,5 @@ Bundle-Name: org.eclipse.jgit.ssh.jsch - Sources Bundle-SymbolicName: org.eclipse.jgit.ssh.jsch.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 6.9.1.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.ssh.jsch;version="6.9.1.qualifier";roots="." +Bundle-Version: 6.10.2.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.ssh.jsch;version="6.10.2.qualifier";roots="."
diff --git a/org.eclipse.jgit.ssh.jsch/pom.xml b/org.eclipse.jgit.ssh.jsch/pom.xml index bd0ff60..bab2eea 100644 --- a/org.eclipse.jgit.ssh.jsch/pom.xml +++ b/org.eclipse.jgit.ssh.jsch/pom.xml
@@ -17,7 +17,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.ssh.jsch</artifactId>
diff --git a/org.eclipse.jgit.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.test/META-INF/MANIFEST.MF index fb6255e..15331d4 100644 --- a/org.eclipse.jgit.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.test/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-Name: %Bundle-Name Automatic-Module-Name: org.eclipse.jgit.test Bundle-SymbolicName: org.eclipse.jgit.test -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-Localization: plugin Bundle-Vendor: %Bundle-Vendor Bundle-RequiredExecutionEnvironment: JavaSE-11 @@ -21,64 +21,64 @@ org.apache.commons.io;version="[2.15.0,3.0.0)", org.apache.commons.io.output;version="[2.15.0,3.0.0)", org.assertj.core.api;version="[3.14.0,4.0.0)", - org.eclipse.jgit.annotations;version="[6.9.1,6.10.0)", - org.eclipse.jgit.api;version="[6.9.1,6.10.0)", - org.eclipse.jgit.api.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.archive;version="[6.9.1,6.10.0)", - org.eclipse.jgit.attributes;version="[6.9.1,6.10.0)", - org.eclipse.jgit.awtui;version="[6.9.1,6.10.0)", - org.eclipse.jgit.blame;version="[6.9.1,6.10.0)", - org.eclipse.jgit.diff;version="[6.9.1,6.10.0)", - org.eclipse.jgit.dircache;version="[6.9.1,6.10.0)", - org.eclipse.jgit.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.events;version="[6.9.1,6.10.0)", - org.eclipse.jgit.fnmatch;version="[6.9.1,6.10.0)", - org.eclipse.jgit.gitrepo;version="[6.9.1,6.10.0)", - org.eclipse.jgit.hooks;version="[6.9.1,6.10.0)", - org.eclipse.jgit.ignore;version="[6.9.1,6.10.0)", - org.eclipse.jgit.ignore.internal;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.diff;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.diffmergetool;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.fsck;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.revwalk;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.commitgraph;version="6.9.1", - org.eclipse.jgit.internal.storage.dfs;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.file;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.io;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.memory;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.pack;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.storage.reftable;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.transport.connectivity;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.transport.http;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.transport.parser;version="[6.9.1,6.10.0)", - org.eclipse.jgit.internal.transport.ssh;version="[6.9.1,6.10.0)", - org.eclipse.jgit.junit;version="[6.9.1,6.10.0)", - org.eclipse.jgit.junit.time;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lfs;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lib;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lib.internal;version="[6.9.1,6.10.0)", - org.eclipse.jgit.logging;version="[6.9.1,6.10.0)", - org.eclipse.jgit.merge;version="[6.9.1,6.10.0)", - org.eclipse.jgit.nls;version="[6.9.1,6.10.0)", - org.eclipse.jgit.notes;version="[6.9.1,6.10.0)", - org.eclipse.jgit.patch;version="[6.9.1,6.10.0)", - org.eclipse.jgit.pgm;version="[6.9.1,6.10.0)", - org.eclipse.jgit.pgm.internal;version="[6.9.1,6.10.0)", - org.eclipse.jgit.revplot;version="[6.9.1,6.10.0)", - org.eclipse.jgit.revwalk;version="[6.9.1,6.10.0)", - org.eclipse.jgit.revwalk.filter;version="[6.9.1,6.10.0)", - org.eclipse.jgit.storage.file;version="[6.9.1,6.10.0)", - org.eclipse.jgit.storage.pack;version="[6.9.1,6.10.0)", - org.eclipse.jgit.submodule;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport.http;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport.resolver;version="[6.9.1,6.10.0)", - org.eclipse.jgit.treewalk;version="[6.9.1,6.10.0)", - org.eclipse.jgit.treewalk.filter;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util.io;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util.sha1;version="[6.9.1,6.10.0)", + org.eclipse.jgit.annotations;version="[6.10.2,6.11.0)", + org.eclipse.jgit.api;version="[6.10.2,6.11.0)", + org.eclipse.jgit.api.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.archive;version="[6.10.2,6.11.0)", + org.eclipse.jgit.attributes;version="[6.10.2,6.11.0)", + org.eclipse.jgit.awtui;version="[6.10.2,6.11.0)", + org.eclipse.jgit.blame;version="[6.10.2,6.11.0)", + org.eclipse.jgit.diff;version="[6.10.2,6.11.0)", + org.eclipse.jgit.dircache;version="[6.10.2,6.11.0)", + org.eclipse.jgit.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.events;version="[6.10.2,6.11.0)", + org.eclipse.jgit.fnmatch;version="[6.10.2,6.11.0)", + org.eclipse.jgit.gitrepo;version="[6.10.2,6.11.0)", + org.eclipse.jgit.hooks;version="[6.10.2,6.11.0)", + org.eclipse.jgit.ignore;version="[6.10.2,6.11.0)", + org.eclipse.jgit.ignore.internal;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.diff;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.diffmergetool;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.fsck;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.revwalk;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.commitgraph;version="6.10.2", + org.eclipse.jgit.internal.storage.dfs;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.file;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.io;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.memory;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.pack;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.storage.reftable;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.transport.connectivity;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.transport.http;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.transport.parser;version="[6.10.2,6.11.0)", + org.eclipse.jgit.internal.transport.ssh;version="[6.10.2,6.11.0)", + org.eclipse.jgit.junit;version="[6.10.2,6.11.0)", + org.eclipse.jgit.junit.time;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lfs;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lib;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lib.internal;version="[6.10.2,6.11.0)", + org.eclipse.jgit.logging;version="[6.10.2,6.11.0)", + org.eclipse.jgit.merge;version="[6.10.2,6.11.0)", + org.eclipse.jgit.nls;version="[6.10.2,6.11.0)", + org.eclipse.jgit.notes;version="[6.10.2,6.11.0)", + org.eclipse.jgit.patch;version="[6.10.2,6.11.0)", + org.eclipse.jgit.pgm;version="[6.10.2,6.11.0)", + org.eclipse.jgit.pgm.internal;version="[6.10.2,6.11.0)", + org.eclipse.jgit.revplot;version="[6.10.2,6.11.0)", + org.eclipse.jgit.revwalk;version="[6.10.2,6.11.0)", + org.eclipse.jgit.revwalk.filter;version="[6.10.2,6.11.0)", + org.eclipse.jgit.storage.file;version="[6.10.2,6.11.0)", + org.eclipse.jgit.storage.pack;version="[6.10.2,6.11.0)", + org.eclipse.jgit.submodule;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport.http;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport.resolver;version="[6.10.2,6.11.0)", + org.eclipse.jgit.treewalk;version="[6.10.2,6.11.0)", + org.eclipse.jgit.treewalk.filter;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util.io;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util.sha1;version="[6.10.2,6.11.0)", org.junit;version="[4.13,5.0.0)", org.junit.experimental.theories;version="[4.13,5.0.0)", org.junit.function;version="[4.13.0,5.0.0)",
diff --git a/org.eclipse.jgit.test/pom.xml b/org.eclipse.jgit.test/pom.xml index fd40586..55dbf31 100644 --- a/org.eclipse.jgit.test/pom.xml +++ b/org.eclipse.jgit.test/pom.xml
@@ -19,7 +19,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.test</artifactId>
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/ConflictOutOfBounds.patch b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/ConflictOutOfBounds.patch new file mode 100644 index 0000000..6e7448b --- /dev/null +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/ConflictOutOfBounds.patch
@@ -0,0 +1,10 @@ +diff --git a/ConflictOutOfBounds b/ConflictOutOfBounds +index 0000000..de98044 +--- a/ConflictOutOfBounds ++++ b/ConflictOutOfBounds +@@ -25,4 +25,4 @@ + line3 +-lineA ++lineB + line5 + line6
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/ConflictOutOfBounds_PostImage b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/ConflictOutOfBounds_PostImage new file mode 100644 index 0000000..4e5d5b2 --- /dev/null +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/ConflictOutOfBounds_PostImage
@@ -0,0 +1,15 @@ +line1 +line2 +line3 +line4 +line5 +line6 +line7 +line8 +<<<<<<< HEAD +======= +line3 +lineB +line5 +line6 +>>>>>>> PATCH
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/ConflictOutOfBounds_PreImage b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/ConflictOutOfBounds_PreImage new file mode 100644 index 0000000..f62562a --- /dev/null +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/ConflictOutOfBounds_PreImage
@@ -0,0 +1,8 @@ +line1 +line2 +line3 +line4 +line5 +line6 +line7 +line8
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/allowconflict.patch b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/allowconflict.patch new file mode 100644 index 0000000..a99e636 --- /dev/null +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/allowconflict.patch
@@ -0,0 +1,10 @@ +diff --git a/allowconflict b/allowconflict +index 0000000..de98044 +--- a/allowconflict ++++ b/allowconflict +@@ -3,4 +3,4 @@ + line3 +-lineA ++lineB + line5 + line6
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/allowconflict_PostImage b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/allowconflict_PostImage new file mode 100644 index 0000000..a963b40 --- /dev/null +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/allowconflict_PostImage
@@ -0,0 +1,15 @@ +line1 +line2 +<<<<<<< HEAD +line3 +line4 +line5 +line6 +======= +line3 +lineB +line5 +line6 +>>>>>>> PATCH +line7 +line8
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/allowconflict_PreImage b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/allowconflict_PreImage new file mode 100644 index 0000000..f62562a --- /dev/null +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/allowconflict_PreImage
@@ -0,0 +1,8 @@ +line1 +line2 +line3 +line4 +line5 +line6 +line7 +line8
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/allowconflict_file_deleted.patch b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/allowconflict_file_deleted.patch new file mode 100644 index 0000000..c9655a5 --- /dev/null +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/allowconflict_file_deleted.patch
@@ -0,0 +1,10 @@ +diff --git a/allowconflict_file_deleted b/allowconflict_file_deleted +index 0000000..de98044 +--- a/allowconflict_file_deleted ++++ b/allowconflict_file_deleted +@@ -3,4 +3,4 @@ + line3 +-lineA ++lineB + line5 + line6
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/greeting.c b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/greeting.c new file mode 100644 index 0000000..3661160 --- /dev/null +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/greeting.c
@@ -0,0 +1,43 @@ +#include <stdio.h> +#include <string.h> +#include <ctype.h> + +void getGreeting(char *result, const char *name) { + sprintf(result, "Hello, %s!", name); +} + +void getFarewell(char *result, const char *name) { + sprintf(result, "Goodbye, %s. Have a great day!", name); +} + +void toLower(char *str) { + for (int i = 0; str[i]; i++) { + str[i] = tolower(str[i]); + } +} + +void getPersonalizedGreeting(char *result, const char *name, const char *timeOfDay) { + char timeOfDayLower[50]; + strcpy(timeOfDayLower, timeOfDay); + toLower(timeOfDayLower); + if (strcmp(timeOfDayLower, "morning") == 0) { + sprintf(result, "Good morning, %s", name); + } else if (strcmp(timeOfDayLower, "afternoon") == 0) { + sprintf(result, "Good afternoon, %s", name); + } else if (strcmp(timeOfDayLower, "evening") == 0) { + sprintf(result, "Good evening, %s", name); + } else { + sprintf(result, "Good day, %s", name); + } +} + +int main() { + char result[100]; + getGreeting(result, "foo"); + printf("%s\\n", result); + getFarewell(result, "bar"); + printf("%s\\n", result); + getPersonalizedGreeting(result, "baz", "morning"); + printf("%s\\n", result); + return 0; +}
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/greeting.javasource b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/greeting.javasource new file mode 100644 index 0000000..9659685 --- /dev/null +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/greeting.javasource
@@ -0,0 +1,37 @@ +public class Greeting { + public String getGreeting(String name) { + String msg = "Hello, " + name + "!"; + return msg; + } + + public String getFarewell(String name) { + String msg = "Goodbye, " + name + ". Have a great day!"; + return msg; + } + + public String getPersonalizedGreeting(String name, String timeOfDay) { + String msg; + switch (timeOfDay.toLowerCase()) { + case "morning": + msg = "Good morning, " + name; + break; + case "afternoon": + msg = "Good afternoon, " + name; + break; + case "evening": + msg = "Good evening, " + name; + break; + default: + msg = "Good day, " + name; + break; + } + return msg; + } + + public static void main(String[] args) { + Greeting greeting = new Greeting(); + System.out.println(greeting.getGreeting("foo")); + System.out.println(greeting.getFarewell("bar")); + System.out.println(greeting.getPersonalizedGreeting("baz", "morning")); + } +}
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/greeting.py b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/greeting.py new file mode 100644 index 0000000..9eda6cd --- /dev/null +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/greeting.py
@@ -0,0 +1,26 @@ +class Greeting: + def get_greeting(self, name): + greeting_message = f"Hello, {name}!" + return greeting_message + + def get_farewell(self, name): + farewell_message = f"Goodbye, {name}. Have a great day!" + return farewell_message + + def get_personalized_greeting(self, name, time_of_day): + time_of_day = time_of_day.lower() + if time_of_day == "morning": + personalized_message = f"Good morning, {name}" + elif time_of_day == "afternoon": + personalized_message = f"Good afternoon, {name}" + elif time_of_day == "evening": + personalized_message = f"Good evening, {name}" + else: + personalized_message = f"Good day, {name}" + return personalized_message + +if __name__ == "__main__": + greeting = Greeting() + print(greeting.get_greeting("foo")) + print(greeting.get_farewell("bar")) + print(greeting.get_personalized_greeting("baz", "morning"))
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/greeting.rs b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/greeting.rs new file mode 100644 index 0000000..a3aa5cb --- /dev/null +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/greeting.rs
@@ -0,0 +1,27 @@ +struct Greeting; + +impl Greeting { + fn get_greeting(&self, name: &str) -> String { + format!("Hello, {}!", name) + } + + fn get_farewell(&self, name: &str) -> String { + format!("Goodbye, {}. Have a great day!", name) + } + + fn get_personalized_greeting(&self, name: &str, time_of_day: &str) -> String { + match time_of_day.to_lowercase().as_str() { + "morning" => format!("Good morning, {}", name), + "afternoon" => format!("Good afternoon, {}", name), + "evening" => format!("Good evening, {}", name), + _ => format!("Good day, {}", name), + } + } +} + +fn main() { + let greeting = Greeting; + println!("{}", greeting.get_greeting("foo")); + println!("{}", greeting.get_farewell("bar")); + println!("{}", greeting.get_personalized_greeting("baz", "morning")); +}
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/sample.dtsi b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/sample.dtsi new file mode 100644 index 0000000..6aa4ecd --- /dev/null +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/sample.dtsi
@@ -0,0 +1,25 @@ +/dts-v1/; + +/ { + model = "Example Board"; + compatible = "example,board"; + cpus { + cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <0>; + }; + }; + + memory { + device_type = "memory"; + reg = <0x80000000 0x20000000>; + }; + + uart0: uart@101f1000 { + compatible = "ns16550a"; + reg = <0x101f1000 0x1000>; + interrupts = <5>; + clock-frequency = <24000000>; + }; +};
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java index db2d5d1..1c2e995 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java
@@ -13,6 +13,8 @@ import static java.nio.charset.StandardCharsets.UTF_8; import static org.eclipse.jgit.util.FileUtils.RECURSIVE; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.junit.Assume.assumeTrue; @@ -607,14 +609,14 @@ public void testAddExistingSingleFileTwice() throws IOException, try (Git git = new Git(db)) { DirCache dc = git.add().addFilepattern("a.txt").call(); - dc.getEntry(0).getObjectId(); + ObjectId oid = dc.getEntry(0).getObjectId(); try (PrintWriter writer = new PrintWriter(file, UTF_8.name())) { writer.print("other content"); } dc = git.add().addFilepattern("a.txt").call(); - + assertNotEquals(oid, dc.getEntry(0).getObjectId()); assertEquals( "[a.txt, mode:100644, content:other content]", indexState(CONTENT)); @@ -632,7 +634,7 @@ public void testAddExistingSingleFileTwiceWithCommit() throws Exception { try (Git git = new Git(db)) { DirCache dc = git.add().addFilepattern("a.txt").call(); - dc.getEntry(0).getObjectId(); + ObjectId oid = dc.getEntry(0).getObjectId(); git.commit().setMessage("commit a.txt").call(); @@ -641,7 +643,7 @@ public void testAddExistingSingleFileTwiceWithCommit() throws Exception { } dc = git.add().addFilepattern("a.txt").call(); - + assertNotEquals(oid, dc.getEntry(0).getObjectId()); assertEquals( "[a.txt, mode:100644, content:other content]", indexState(CONTENT)); @@ -659,12 +661,12 @@ public void testAddRemovedFile() throws Exception { try (Git git = new Git(db)) { DirCache dc = git.add().addFilepattern("a.txt").call(); - dc.getEntry(0).getObjectId(); + ObjectId oid = dc.getEntry(0).getObjectId(); FileUtils.delete(file); // is supposed to do nothing dc = git.add().addFilepattern("a.txt").call(); - + assertEquals(oid, dc.getEntry(0).getObjectId()); assertEquals( "[a.txt, mode:100644, content:content]", indexState(CONTENT)); @@ -684,12 +686,12 @@ public void testAddRemovedCommittedFile() throws Exception { git.commit().setMessage("commit a.txt").call(); - dc.getEntry(0).getObjectId(); + ObjectId oid = dc.getEntry(0).getObjectId(); FileUtils.delete(file); // is supposed to do nothing dc = git.add().addFilepattern("a.txt").call(); - + assertEquals(oid, dc.getEntry(0).getObjectId()); assertEquals( "[a.txt, mode:100644, content:content]", indexState(CONTENT)); @@ -878,7 +880,7 @@ public void testAddAllNoRenormalize() throws Exception { } } // Help null pointer analysis. - assert lastFile != null; + assertNotNull(lastFile); // Wait a bit. If entries are "racily clean", we'll recompute // hashes from the disk files, and then the second add is also slow. // We want to test the normal case. @@ -1259,7 +1261,7 @@ public void testAddGitlink() throws Exception { "[git-link-dir, mode:160000]", indexState(0)); Set<String> untrackedFiles = git.status().call().getUntracked(); - assert (untrackedFiles.isEmpty()); + assertTrue(untrackedFiles.isEmpty()); } } @@ -1274,7 +1276,8 @@ public void testAddSubrepoWithDirNoGitlinks() throws Exception { ConfigConstants.CONFIG_KEY_DIRNOGITLINKS, true); config.save(); - assert (db.getConfig().get(WorkingTreeOptions.KEY).isDirNoGitLinks()); + assertTrue( + db.getConfig().get(WorkingTreeOptions.KEY).isDirNoGitLinks()); try (Git git = new Git(db)) { git.add().addFilepattern("nested-repo").call();
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitAndLogCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitAndLogCommandTest.java index b7abba4..57e5d49 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitAndLogCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitAndLogCommandTest.java
@@ -284,11 +284,10 @@ public void testInsertChangeId() throws Exception { // template) chars = commit.getFullMessage().getBytes(UTF_8); int lineStart = 0; - int lineEnd = 0; for (int i = 0; i < 4; i++) { lineStart = RawParseUtils.nextLF(chars, lineStart); } - lineEnd = RawParseUtils.nextLF(chars, lineStart); + int lineEnd = RawParseUtils.nextLF(chars, lineStart); String line = RawParseUtils.decode(chars, lineStart, lineEnd); @@ -303,13 +302,12 @@ public void testInsertChangeId() throws Exception { // we should find the untouched template chars = commit.getFullMessage().getBytes(UTF_8); lineStart = 0; - lineEnd = 0; for (int i = 0; i < 4; i++) { lineStart = RawParseUtils.nextLF(chars, lineStart); } lineEnd = RawParseUtils.nextLF(chars, lineStart); - line = RawParseUtils.decode(chars, lineStart, lineEnd); + RawParseUtils.decode(chars, lineStart, lineEnd); assertTrue(commit.getFullMessage() .contains("Change-Id: I" + ObjectId.zeroId().getName()));
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PathCheckoutCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PathCheckoutCommandTest.java index f52b715..cf952d2 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PathCheckoutCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PathCheckoutCommandTest.java
@@ -172,9 +172,9 @@ public void testCheckoutMultiple() throws Exception { @Test public void testUpdateWorkingDirectoryFromIndex() throws Exception { CheckoutCommand co = git.checkout(); - File written = writeTrashFile(FILE1, "3a"); + writeTrashFile(FILE1, "3a"); git.add().addFilepattern(FILE1).call(); - written = writeTrashFile(FILE1, ""); + File written = writeTrashFile(FILE1, ""); assertEquals("", read(written)); co.addPath(FILE1).call(); assertEquals("3a", read(written)); @@ -185,9 +185,9 @@ public void testUpdateWorkingDirectoryFromIndex() throws Exception { public void testUpdateWorkingDirectoryFromHeadWithIndexChange() throws Exception { CheckoutCommand co = git.checkout(); - File written = writeTrashFile(FILE1, "3a"); + writeTrashFile(FILE1, "3a"); git.add().addFilepattern(FILE1).call(); - written = writeTrashFile(FILE1, ""); + File written = writeTrashFile(FILE1, ""); assertEquals("", read(written)); co.addPath(FILE1).setStartPoint("HEAD").call(); assertEquals("3", read(written));
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java index 987c98e..02e3a2e 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java
@@ -2650,7 +2650,9 @@ public void testRebaseShouldTryToParseValidLineMarkedAsComment() assertEquals("1111111", firstLine.getCommit().name()); assertEquals("pick", firstLine.getAction().toToken()); } catch (Exception e) { - fail("Valid parsable RebaseTodoLine that has been commented out should allow to change the action, but failed"); + throw new AssertionError( + "Valid parsable RebaseTodoLine that has been commented out should allow to change the action, but failed", + e); } assertEquals("2222222", steps.get(1).getCommit().name());
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashDropCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashDropCommandTest.java index f9af968..c81731d 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashDropCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashDropCommandTest.java
@@ -69,8 +69,7 @@ public void dropWithInvalidLogIndex() throws Exception { RevCommit stashed = git.stashCreate().call(); assertNotNull(stashed); stashRef = git.getRepository().exactRef(Constants.R_STASH); - assertEquals(stashed, - git.getRepository().exactRef(Constants.R_STASH).getObjectId()); + assertEquals(stashed, stashRef.getObjectId()); try { assertNull(git.stashDrop().setStashRef(100).call()); fail("Exception not thrown"); @@ -88,8 +87,7 @@ public void dropSingleStashedCommit() throws Exception { RevCommit stashed = git.stashCreate().call(); assertNotNull(stashed); stashRef = git.getRepository().exactRef(Constants.R_STASH); - assertEquals(stashed, - git.getRepository().exactRef(Constants.R_STASH).getObjectId()); + assertEquals(stashed, stashRef.getObjectId()); assertNull(git.stashDrop().call()); stashRef = git.getRepository().exactRef(Constants.R_STASH); assertNull(stashRef);
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/CGitAttributesTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/CGitAttributesTest.java index 5638c1f..562a515 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/CGitAttributesTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/CGitAttributesTest.java
@@ -104,10 +104,9 @@ private LinkedHashMap<String, Attributes> cgitAttributes( UTF_8))) { r.lines().forEach(line -> { // Parse the line and add to result map - int start = 0; int i = line.indexOf(':'); String path = line.substring(0, i).trim(); - start = i + 1; + int start = i + 1; i = line.indexOf(':', start); String key = line.substring(start, i).trim(); String value = line.substring(i + 1).trim();
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/TreeWalkAttributeTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/TreeWalkAttributeTest.java index 73abd2d..698fdb3 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/TreeWalkAttributeTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/TreeWalkAttributeTest.java
@@ -791,7 +791,7 @@ private static Set<Attribute> asSet(Collection<Attribute> attributes) { for (Attribute a : attributes) { ret.add(a); } - return (ret); + return ret; } private File writeAttributesFile(String name, String... rules)
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/merge/MergeGitAttributeTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/merge/MergeGitAttributeTest.java index 7950291..ac30c6c 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/merge/MergeGitAttributeTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/merge/MergeGitAttributeTest.java
@@ -10,7 +10,6 @@ package org.eclipse.jgit.attributes.merge; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; @@ -20,6 +19,7 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; +import java.io.UncheckedIOException; import java.nio.file.Files; import java.util.function.Consumer; @@ -42,7 +42,6 @@ import org.eclipse.jgit.treewalk.FileTreeIterator; import org.eclipse.jgit.treewalk.TreeWalk; import org.eclipse.jgit.treewalk.filter.PathFilter; -import org.junit.Ignore; import org.junit.Test; public class MergeGitAttributeTest extends RepositoryTestCase { @@ -99,19 +98,19 @@ public void mergeTextualFile_NoAttr() throws NoWorkTreeException, try { writeTrashFile("main.cat", "A\n" + "B\n" + "C\n" + "D\n"); } catch (IOException e) { - e.printStackTrace(); + throw new UncheckedIOException(e); } }, g -> { try { writeTrashFile("main.cat", "A\n" + "B\n" + "C\n" + "F\n"); } catch (IOException e) { - e.printStackTrace(); + throw new UncheckedIOException(e); } }, g -> { try { writeTrashFile("main.cat", "A\n" + "E\n" + "C\n" + "D\n"); } catch (IOException e) { - e.printStackTrace(); + throw new UncheckedIOException(e); } })) { checkoutBranch(REFS_HEADS_LEFT); @@ -141,19 +140,19 @@ public void mergeTextualFile_UnsetMerge_Conflict() writeTrashFile(".gitattributes", "*.cat -merge"); writeTrashFile("main.cat", "A\n" + "B\n" + "C\n" + "D\n"); } catch (IOException e) { - e.printStackTrace(); + throw new UncheckedIOException(e); } }, g -> { try { writeTrashFile("main.cat", "A\n" + "B\n" + "C\n" + "F\n"); } catch (IOException e) { - e.printStackTrace(); + throw new UncheckedIOException(e); } }, g -> { try { writeTrashFile("main.cat", "A\n" + "E\n" + "C\n" + "D\n"); } catch (IOException e) { - e.printStackTrace(); + throw new UncheckedIOException(e); } })) { // Check that the merge attribute is unset @@ -186,19 +185,19 @@ public void mergeTextualFile_UnsetMerge_NoConflict() writeTrashFile(".gitattributes", "*.txt -merge"); writeTrashFile("main.cat", "A\n" + "B\n" + "C\n" + "D\n"); } catch (IOException e) { - e.printStackTrace(); + throw new UncheckedIOException(e); } }, g -> { try { writeTrashFile("main.cat", "A\n" + "B\n" + "C\n" + "F\n"); } catch (IOException e) { - e.printStackTrace(); + throw new UncheckedIOException(e); } }, g -> { try { writeTrashFile("main.cat", "A\n" + "E\n" + "C\n" + "D\n"); } catch (IOException e) { - e.printStackTrace(); + throw new UncheckedIOException(e); } })) { // Check that the merge attribute is unset @@ -230,19 +229,19 @@ public void mergeTextualFile_SetBinaryMerge_Conflict() writeTrashFile(".gitattributes", "*.cat merge=binary"); writeTrashFile("main.cat", "A\n" + "B\n" + "C\n" + "D\n"); } catch (IOException e) { - e.printStackTrace(); + throw new UncheckedIOException(e); } }, g -> { try { writeTrashFile("main.cat", "A\n" + "B\n" + "C\n" + "F\n"); } catch (IOException e) { - e.printStackTrace(); + throw new UncheckedIOException(e); } }, g -> { try { writeTrashFile("main.cat", "A\n" + "E\n" + "C\n" + "D\n"); } catch (IOException e) { - e.printStackTrace(); + throw new UncheckedIOException(e); } })) { // Check that the merge attribute is set to binary @@ -268,12 +267,52 @@ public void mergeTextualFile_SetBinaryMerge_Conflict() } } - /* - * This test is commented because JGit add conflict markers in binary files. - * cf. https://www.eclipse.org/forums/index.php/t/1086511/ - */ @Test - @Ignore + public void mergeTextualFile_SetUnionMerge() throws NoWorkTreeException, + NoFilepatternException, GitAPIException, IOException { + try (Git git = createRepositoryBinaryConflict(g -> { + try { + writeTrashFile(".gitattributes", "*.cat merge=union"); + writeTrashFile("main.cat", "A\n" + "B\n" + "C\n" + "D\n"); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + }, g -> { + try { + writeTrashFile("main.cat", "A\n" + "G\n" + "C\n" + "F\n"); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + }, g -> { + try { + writeTrashFile("main.cat", "A\n" + "E\n" + "C\n" + "D\n"); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + })) { + // Check that the merge attribute is set to union + assertAddMergeAttributeCustom(REFS_HEADS_LEFT, "main.cat", "union"); + assertAddMergeAttributeCustom(REFS_HEADS_RIGHT, "main.cat", + "union"); + + checkoutBranch(REFS_HEADS_LEFT); + // Merge refs/heads/left -> refs/heads/right + + MergeResult mergeResult = git.merge() + .include(git.getRepository().resolve(REFS_HEADS_RIGHT)) + .call(); + assertEquals(MergeStatus.MERGED, mergeResult.getMergeStatus()); + + // Check that the file is the union of both branches (no conflict + // marker added) + String result = read(writeTrashFile("res.cat", + "A\n" + "G\n" + "E\n" + "C\n" + "F\n")); + assertEquals(result, read(git.getRepository().getWorkTree().toPath() + .resolve("main.cat").toFile())); + } + } + + @Test public void mergeBinaryFile_NoAttr_Conflict() throws IllegalStateException, IOException, NoHeadException, ConcurrentRefUpdateException, CheckoutConflictException, InvalidMergeHeadsException, @@ -433,7 +472,7 @@ public void mergeBinaryFile_SetMerge_Conflict() try (FileInputStream mergeResultFile = new FileInputStream( db.getWorkTree().toPath().resolve(ENABLED_CHECKED_GIF) .toFile())) { - assertFalse(contentEquals( + assertTrue(contentEquals( getClass().getResourceAsStream(ENABLED_CHECKED_GIF), mergeResultFile)); }
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterBuiltInDriverTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterBuiltInDriverTest.java new file mode 100644 index 0000000..1352871 --- /dev/null +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterBuiltInDriverTest.java
@@ -0,0 +1,173 @@ +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. + * and other copyright owners as documented in the project's IP log. + * + * 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.diff; + +import static org.junit.Assert.assertEquals; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.stream.Collectors; +import org.eclipse.jgit.api.Git; +import org.eclipse.jgit.api.errors.GitAPIException; +import org.eclipse.jgit.junit.JGitTestUtil; +import org.eclipse.jgit.junit.RepositoryTestCase; +import org.eclipse.jgit.revwalk.RevCommit; +import org.eclipse.jgit.treewalk.CanonicalTreeParser; +import org.junit.Test; + +public class DiffFormatterBuiltInDriverTest extends RepositoryTestCase { + @Test + public void testCppDriver() throws Exception { + String fileName = "greeting.c"; + String body = Files.readString( + Path.of(JGitTestUtil.getTestResourceFile(fileName) + .getAbsolutePath())); + RevCommit c1; + RevCommit c2; + try (Git git = new Git(db)) { + createCommit(git, ".gitattributes", "*.c diff=cpp"); + c1 = createCommit(git, fileName, body); + c2 = createCommit(git, fileName, + body.replace("Good day", "Greetings") + .replace("baz", "qux")); + } + try (ByteArrayOutputStream os = new ByteArrayOutputStream(); + DiffFormatter diffFormatter = new DiffFormatter(os)) { + String actual = getHunkHeaders(c1, c2, os, diffFormatter); + String expected = + "@@ -27,7 +27,7 @@ void getPersonalizedGreeting(char *result, const char *name, const char *timeOfD\n" + + "@@ -37,7 +37,7 @@ int main() {"; + assertEquals(expected, actual); + } + } + + @Test + public void testDtsDriver() throws Exception { + String fileName = "sample.dtsi"; + String body = Files.readString( + Path.of(JGitTestUtil.getTestResourceFile(fileName) + .getAbsolutePath())); + RevCommit c1; + RevCommit c2; + try (Git git = new Git(db)) { + createCommit(git, ".gitattributes", "*.dtsi diff=dts"); + c1 = createCommit(git, fileName, body); + c2 = createCommit(git, fileName, + body.replace("clock-frequency = <24000000>", + "clock-frequency = <48000000>")); + } + try (ByteArrayOutputStream os = new ByteArrayOutputStream(); + DiffFormatter diffFormatter = new DiffFormatter(os)) { + String actual = getHunkHeaders(c1, c2, os, diffFormatter); + String expected = "@@ -20,6 +20,6 @@ uart0: uart@101f1000 {"; + assertEquals(expected, actual); + } + } + + @Test + public void testJavaDriver() throws Exception { + String resourceName = "greeting.javasource"; + String body = Files.readString( + Path.of(JGitTestUtil.getTestResourceFile(resourceName) + .getAbsolutePath())); + RevCommit c1; + RevCommit c2; + try (Git git = new Git(db)) { + createCommit(git, ".gitattributes", "*.java diff=java"); + String fileName = "Greeting.java"; + c1 = createCommit(git, fileName, body); + c2 = createCommit(git, fileName, + body.replace("Good day", "Greetings") + .replace("baz", "qux")); + } + try (ByteArrayOutputStream os = new ByteArrayOutputStream(); + DiffFormatter diffFormatter = new DiffFormatter(os)) { + String actual = getHunkHeaders(c1, c2, os, diffFormatter); + String expected = + "@@ -22,7 +22,7 @@ public String getPersonalizedGreeting(String name, String timeOfDay) {\n" + + "@@ -32,6 +32,6 @@ public static void main(String[] args) {"; + assertEquals(expected, actual); + } + } + + @Test + public void testPythonDriver() throws Exception { + String fileName = "greeting.py"; + String body = Files.readString( + Path.of(JGitTestUtil.getTestResourceFile(fileName) + .getAbsolutePath())); + RevCommit c1; + RevCommit c2; + try (Git git = new Git(db)) { + createCommit(git, ".gitattributes", "*.py diff=python"); + c1 = createCommit(git, fileName, body); + c2 = createCommit(git, fileName, + body.replace("Good day", "Greetings")); + } + try (ByteArrayOutputStream os = new ByteArrayOutputStream(); + DiffFormatter diffFormatter = new DiffFormatter(os)) { + String actual = getHunkHeaders(c1, c2, os, diffFormatter); + String expected = "@@ -16,7 +16,7 @@ def get_personalized_greeting(self, name, time_of_day):"; + assertEquals(expected, actual); + } + } + + @Test + public void testRustDriver() throws Exception { + String fileName = "greeting.rs"; + String body = Files.readString( + Path.of(JGitTestUtil.getTestResourceFile(fileName) + .getAbsolutePath())); + RevCommit c1; + RevCommit c2; + try (Git git = new Git(db)) { + createCommit(git, ".gitattributes", "*.rs diff=rust"); + c1 = createCommit(git, fileName, body); + c2 = createCommit(git, fileName, + body.replace("Good day", "Greetings") + .replace("baz", "qux")); + } + try (ByteArrayOutputStream os = new ByteArrayOutputStream(); + DiffFormatter diffFormatter = new DiffFormatter(os)) { + String actual = getHunkHeaders(c1, c2, os, diffFormatter); + String expected = + "@@ -14,7 +14,7 @@ fn get_personalized_greeting(&self, name: &str, time_of_day: &str) -> String {\n" + + "@@ -23,5 +23,5 @@ fn main() {"; + assertEquals(expected, actual); + } + } + + private String getHunkHeaders(RevCommit c1, RevCommit c2, + ByteArrayOutputStream os, DiffFormatter diffFormatter) + throws IOException { + diffFormatter.setRepository(db); + diffFormatter.format(new CanonicalTreeParser(null, db.newObjectReader(), + c1.getTree()), + new CanonicalTreeParser(null, db.newObjectReader(), + c2.getTree())); + diffFormatter.flush(); + return Arrays.stream(os.toString(StandardCharsets.UTF_8).split("\n")) + .filter(line -> line.startsWith("@@")) + .collect(Collectors.joining("\n")); + } + + private RevCommit createCommit(Git git, String fileName, String body) + throws IOException, GitAPIException { + writeTrashFile(fileName, body); + git.add().addFilepattern(".").call(); + return git.commit().setMessage("message").call(); + } +}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderTest.java index 703d68b..6180110 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderTest.java
@@ -218,7 +218,7 @@ final class ReceivedEventMarkerException extends RuntimeException { try { b.commit(); } catch (ReceivedEventMarkerException e) { - fail("unexpected IndexChangedEvent"); + throw new AssertionError("unexpected IndexChangedEvent", e); } }
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/BareSuperprojectWriterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/BareSuperprojectWriterTest.java index c3b9387..5065b57 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/BareSuperprojectWriterTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/BareSuperprojectWriterTest.java
@@ -12,6 +12,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.nullValue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -22,6 +23,7 @@ import org.eclipse.jgit.gitrepo.BareSuperprojectWriter.BareWriterConfig; import org.eclipse.jgit.gitrepo.RepoCommand.RemoteReader; import org.eclipse.jgit.junit.RepositoryTestCase; +import org.eclipse.jgit.lib.Config; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectReader; import org.eclipse.jgit.lib.Repository; @@ -68,6 +70,49 @@ public void write_setGitModulesContents() throws Exception { } @Test + public void write_setGitModulesContents_pinned() throws Exception { + try (Repository bareRepo = createBareRepository()) { + RepoProject pinWithUpstream = new RepoProject("pinWithUpstream", + "path/x", "cbc0fae7e1911d27e1de37d364698dba4411c78b", + "remote", ""); + pinWithUpstream.setUrl("http://example.com/a"); + pinWithUpstream.setUpstream("branchX"); + + RepoProject pinWithoutUpstream = new RepoProject( + "pinWithoutUpstream", "path/y", + "cbc0fae7e1911d27e1de37d364698dba4411c78b", "remote", ""); + pinWithoutUpstream.setUrl("http://example.com/b"); + + RemoteReader mockRemoteReader = mock(RemoteReader.class); + + BareSuperprojectWriter w = new BareSuperprojectWriter(bareRepo, + null, "refs/heads/master", author, mockRemoteReader, + BareWriterConfig.getDefault(), List.of()); + + RevCommit commit = w + .write(Arrays.asList(pinWithUpstream, pinWithoutUpstream)); + + String contents = readContents(bareRepo, commit, ".gitmodules"); + Config cfg = new Config(); + cfg.fromText(contents); + + assertThat(cfg.getString("submodule", "pinWithUpstream", "path"), + is("path/x")); + assertThat(cfg.getString("submodule", "pinWithUpstream", "url"), + is("http://example.com/a")); + assertThat(cfg.getString("submodule", "pinWithUpstream", "ref"), + is("branchX")); + + assertThat(cfg.getString("submodule", "pinWithoutUpstream", "path"), + is("path/y")); + assertThat(cfg.getString("submodule", "pinWithoutUpstream", "url"), + is("http://example.com/b")); + assertThat(cfg.getString("submodule", "pinWithoutUpstream", "ref"), + nullValue()); + } + } + + @Test public void write_setExtraContents() throws Exception { try (Repository bareRepo = createBareRepository()) { RepoProject repoProject = new RepoProject("subprojectX", "path/to",
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/ManifestParserTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/ManifestParserTest.java index c9a0b0b..0949d04 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/ManifestParserTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/ManifestParserTest.java
@@ -11,6 +11,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -22,7 +23,9 @@ import java.nio.file.Files; import java.nio.file.StandardOpenOption; import java.util.HashSet; +import java.util.Map; import java.util.Set; +import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -142,6 +145,72 @@ public void testRemoveProject() throws Exception { .collect(Collectors.toSet())); } + @Test + public void testPinProjectWithUpstream() throws Exception { + StringBuilder xmlContent = new StringBuilder(); + xmlContent.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") + .append("<manifest>") + .append("<remote name=\"remote1\" fetch=\".\" />") + .append("<default revision=\"master\" remote=\"remote1\" />") + .append("<project path=\"foo\" name=\"pin-with-upstream\"") + .append(" revision=\"9b2fe85c0279f4d5ac69f07ddcd48566c3555405\"") + .append(" upstream=\"branchX\"/>") + .append("<project path=\"bar\" name=\"pin-without-upstream\"") + .append(" revision=\"76ce6d91a2e07fdfcbfc8df6970c9e98a98e36a0\" />") + .append("</manifest>"); + + ManifestParser parser = new ManifestParser(null, null, "master", + "https://git.google.com/", null, null); + parser.read(new ByteArrayInputStream( + xmlContent.toString().getBytes(UTF_8))); + + Map<String, RepoProject> repos = parser.getProjects().stream().collect( + Collectors.toMap(RepoProject::getName, Function.identity())); + assertEquals(2, repos.size()); + + RepoProject foo = repos.get("pin-with-upstream"); + assertEquals("pin-with-upstream", foo.getName()); + assertEquals("9b2fe85c0279f4d5ac69f07ddcd48566c3555405", + foo.getRevision()); + assertEquals("branchX", foo.getUpstream()); + + RepoProject bar = repos.get("pin-without-upstream"); + assertEquals("pin-without-upstream", bar.getName()); + assertEquals("76ce6d91a2e07fdfcbfc8df6970c9e98a98e36a0", + bar.getRevision()); + assertNull(bar.getUpstream()); + } + + @Test + public void testWithDestBranch() throws Exception { + StringBuilder xmlContent = new StringBuilder(); + xmlContent.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") + .append("<manifest>") + .append("<remote name=\"remote1\" fetch=\".\" />") + .append("<default revision=\"master\" remote=\"remote1\" />") + .append("<project path=\"foo\" name=\"foo\"") + .append(" dest-branch=\"branchX\"/>") + .append("<project path=\"bar\" name=\"bar\"/>") + .append("</manifest>"); + + ManifestParser parser = new ManifestParser(null, null, "master", + "https://git.google.com/", null, null); + parser.read(new ByteArrayInputStream( + xmlContent.toString().getBytes(UTF_8))); + + Map<String, RepoProject> repos = parser.getProjects().stream().collect( + Collectors.toMap(RepoProject::getName, Function.identity())); + assertEquals(2, repos.size()); + + RepoProject foo = repos.get("foo"); + assertEquals("foo", foo.getName()); + assertEquals("branchX", foo.getDestBranch()); + + RepoProject bar = repos.get("bar"); + assertEquals("bar", bar.getName()); + assertNull(bar.getDestBranch()); + } + void testNormalize(String in, String want) { URI got = ManifestParser.normalizeEmptyPath(URI.create(in)); if (!got.toString().equals(want)) {
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/RepoCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/RepoCommandTest.java index ca6f2e1..3162e79 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/RepoCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/RepoCommandTest.java
@@ -1171,6 +1171,94 @@ public void testRecordRemoteBranch() throws Exception { } } + @Test + public void testRecordRemoteBranch_pinned() throws Exception { + Repository remoteDb = createBareRepository(); + Repository tempDb = createWorkRepository(); + + StringBuilder xmlContent = new StringBuilder(); + xmlContent.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") + .append("<manifest>") + .append("<remote name=\"remote1\" fetch=\".\" />") + .append("<default revision=\"master\" remote=\"remote1\" />") + .append("<project path=\"pin-noupstream\"") + .append(" name=\"pin-noupstream\"") + .append(" revision=\"76ce6d91a2e07fdfcbfc8df6970c9e98a98e36a0\" />") + .append("<project path=\"pin-upstream\"") + .append(" name=\"pin-upstream\"") + .append(" upstream=\"branchX\"") + .append(" revision=\"76ce6d91a2e07fdfcbfc8df6970c9e98a98e36a0\" />") + .append("</manifest>"); + JGitTestUtil.writeTrashFile(tempDb, "manifest.xml", + xmlContent.toString()); + + RepoCommand command = new RepoCommand(remoteDb); + command.setPath( + tempDb.getWorkTree().getAbsolutePath() + "/manifest.xml") + .setURI(rootUri).setRecordRemoteBranch(true).call(); + // Clone it + File directory = createTempDirectory("testBareRepo"); + try (Repository localDb = Git.cloneRepository().setDirectory(directory) + .setURI(remoteDb.getDirectory().toURI().toString()).call() + .getRepository();) { + // The .gitmodules file should exist + File gitmodules = new File(localDb.getWorkTree(), ".gitmodules"); + assertTrue("The .gitmodules file should exist", + gitmodules.exists()); + FileBasedConfig c = new FileBasedConfig(gitmodules, FS.DETECTED); + c.load(); + assertEquals("Pinned submodule with upstream records the ref", + "branchX", c.getString("submodule", "pin-upstream", "ref")); + assertNull("Pinned submodule without upstream don't have ref", + c.getString("submodule", "pin-noupstream", "ref")); + } + } + + @Test + public void testRecordRemoteBranch_pinned_nameConflict() throws Exception { + Repository remoteDb = createBareRepository(); + Repository tempDb = createWorkRepository(); + + StringBuilder xmlContent = new StringBuilder(); + xmlContent.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") + .append("<manifest>") + .append("<remote name=\"remote1\" fetch=\".\" />") + .append("<default revision=\"master\" remote=\"remote1\" />") + .append("<project path=\"pin-upstream\"") + .append(" name=\"pin-upstream\"") + .append(" upstream=\"branchX\"") + .append(" revision=\"76ce6d91a2e07fdfcbfc8df6970c9e98a98e36a0\" />") + .append("<project path=\"pin-upstream-name-conflict\"") + .append(" name=\"pin-upstream\"") + .append(" upstream=\"branchX\"") + .append(" revision=\"76ce6d91a2e07fdfcbfc8df6970c9e98a98e36a0\" />") + .append("</manifest>"); + JGitTestUtil.writeTrashFile(tempDb, "manifest.xml", + xmlContent.toString()); + + RepoCommand command = new RepoCommand(remoteDb); + command.setPath( + tempDb.getWorkTree().getAbsolutePath() + "/manifest.xml") + .setURI(rootUri).setRecordRemoteBranch(true).call(); + // Clone it + File directory = createTempDirectory("testBareRepo"); + try (Repository localDb = Git.cloneRepository().setDirectory(directory) + .setURI(remoteDb.getDirectory().toURI().toString()).call() + .getRepository();) { + // The .gitmodules file should exist + File gitmodules = new File(localDb.getWorkTree(), ".gitmodules"); + assertTrue("The .gitmodules file should exist", + gitmodules.exists()); + FileBasedConfig c = new FileBasedConfig(gitmodules, FS.DETECTED); + c.load(); + assertEquals("Upstream is preserved in name conflict", "branchX", + c.getString("submodule", "pin-upstream/pin-upstream", + "ref")); + assertEquals("Upstream is preserved in name conflict (other side)", + "branchX", c.getString("submodule", + "pin-upstream/pin-upstream-name-conflict", "ref")); + } + } @Test public void testRecordSubmoduleLabels() throws Exception {
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 05360dc..e193de9 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
@@ -18,10 +18,11 @@ import java.util.Arrays; import java.util.Collections; import java.util.concurrent.TimeUnit; - import org.eclipse.jgit.internal.storage.commitgraph.CommitGraph; import org.eclipse.jgit.internal.storage.commitgraph.CommitGraphWriter; import org.eclipse.jgit.internal.storage.dfs.DfsObjDatabase.PackSource; +import org.eclipse.jgit.internal.storage.file.PackBitmapIndex; +import org.eclipse.jgit.internal.storage.pack.PackExt; import org.eclipse.jgit.internal.storage.reftable.RefCursor; import org.eclipse.jgit.internal.storage.reftable.ReftableConfig; import org.eclipse.jgit.internal.storage.reftable.ReftableReader; @@ -30,6 +31,8 @@ import org.eclipse.jgit.junit.TestRepository; import org.eclipse.jgit.lib.AnyObjectId; import org.eclipse.jgit.lib.BatchRefUpdate; +import org.eclipse.jgit.lib.Config; +import org.eclipse.jgit.lib.ConfigConstants; import org.eclipse.jgit.lib.NullProgressMonitor; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectIdRef; @@ -1121,6 +1124,40 @@ public void produceCommitGraphAndBloomFilter() throws Exception { } @Test + public void testReadChangedPathConfigAsFalse() throws Exception { + String head = "refs/heads/head1"; + git.branch(head).commit().message("0").noParents().create(); + gcWithCommitGraphAndBloomFilter(); + + Config repoConfig = odb.getRepository().getConfig(); + repoConfig.setBoolean(ConfigConstants.CONFIG_COMMIT_GRAPH_SECTION, null, + ConfigConstants.CONFIG_KEY_READ_CHANGED_PATHS, false); + + DfsPackFile gcPack = odb.getPacks()[0]; + try (DfsReader reader = odb.newReader()) { + CommitGraph cg = gcPack.getCommitGraph(reader); + assertNull(cg.getChangedPathFilter(0)); + } + } + + @Test + public void testReadChangedPathConfigAsTrue() throws Exception { + String head = "refs/heads/head1"; + git.branch(head).commit().message("0").noParents().create(); + gcWithCommitGraphAndBloomFilter(); + + Config repoConfig = odb.getRepository().getConfig(); + repoConfig.setBoolean(ConfigConstants.CONFIG_COMMIT_GRAPH_SECTION, null, + ConfigConstants.CONFIG_KEY_READ_CHANGED_PATHS, true); + + DfsPackFile gcPack = odb.getPacks()[0]; + try (DfsReader reader = odb.newReader()) { + CommitGraph cg = gcPack.getCommitGraph(reader); + assertNotNull(cg.getChangedPathFilter(0)); + } + } + + @Test public void objectSizeIdx_reachableBlob_bigEnough_indexed() throws Exception { String master = "refs/heads/master"; RevCommit root = git.branch(master).commit().message("root").noParents() @@ -1178,6 +1215,71 @@ public void objectSizeIndex_unreachableGarbage_noIdx() throws Exception { assertFalse(gcRestPack.hasObjectSizeIndex(reader)); } + @Test + public void bitmapIndexWrittenDuringGc() throws Exception { + int numBranches = 2; + int commitsPerBranch = 50; + + RevCommit commit0 = commit().message("0").create(); + git.update("branch0", commit0); + RevCommit branch1 = commitChain(commit0, commitsPerBranch); + git.update("branch1", branch1); + RevCommit branch2 = commitChain(commit0, commitsPerBranch); + git.update("branch2", branch2); + + int contiguousCommitCount = 5; + int recentCommitSpan = 2; + int recentCommitCount = 10; + int distantCommitSpan = 5; + + PackConfig packConfig = new PackConfig(); + packConfig.setBitmapContiguousCommitCount(contiguousCommitCount); + packConfig.setBitmapRecentCommitSpan(recentCommitSpan); + packConfig.setBitmapRecentCommitCount(recentCommitCount); + packConfig.setBitmapDistantCommitSpan(distantCommitSpan); + + DfsGarbageCollector gc = new DfsGarbageCollector(repo); + gc.setPackConfig(packConfig); + run(gc); + + DfsPackFile pack = odb.getPacks()[0]; + PackBitmapIndex bitmapIndex = pack.getBitmapIndex(odb.newReader()); + assertTrue("pack file has bitmap index extension", + pack.getPackDescription().hasFileExt(PackExt.BITMAP_INDEX)); + + int recentCommitsPerBranch = (recentCommitCount - contiguousCommitCount + - 1) / recentCommitSpan; + assertEquals("expected recent commits", 2, recentCommitsPerBranch); + + int distantCommitsPerBranch = (commitsPerBranch - 1 - recentCommitCount) + / distantCommitSpan; + assertEquals("expected distant commits", 7, distantCommitsPerBranch); + + int branchBitmapsCount = contiguousCommitCount + + numBranches + * (recentCommitsPerBranch + + distantCommitsPerBranch); + assertEquals("expected bitmaps count", 23, branchBitmapsCount); + assertEquals("bitmap index has expected number of bitmaps", + branchBitmapsCount, + bitmapIndex.getBitmapCount()); + + // The count is just a function of whether any bitmaps happen to + // compress efficiently against the others in the index. We expect for + // this test that this there will be at least one like this, but the + // actual count is situation-specific + assertTrue("bitmap index has xor-compressed bitmaps", + bitmapIndex.getXorBitmapCount() > 0); + } + + private RevCommit commitChain(RevCommit parent, int length) + throws Exception { + for (int i = 0; i < length; i++) { + parent = commit().message("" + i).parent(parent).create(); + } + return parent; + } + private static DfsPackFile findFirstBySource(DfsPackFile[] packs, PackSource source) { return Arrays.stream(packs) .filter(p -> p.getPackDescription().getPackSource() == source)
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsPackFileTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsPackFileTest.java index 44694ac..d21e51f 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsPackFileTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsPackFileTest.java
@@ -10,7 +10,9 @@ package org.eclipse.jgit.internal.storage.dfs; +import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_COMMIT_GRAPH_SECTION; import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_MIN_BYTES_OBJ_SIZE_INDEX; +import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_READ_CHANGED_PATHS; import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_PACK_SECTION; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -24,6 +26,7 @@ import java.util.Map; import java.util.zip.Deflater; +import org.eclipse.jgit.internal.storage.commitgraph.CommitGraph; import org.eclipse.jgit.internal.storage.dfs.DfsObjDatabase.PackSource; import org.eclipse.jgit.internal.storage.dfs.DfsReader.PackLoadListener; import org.eclipse.jgit.internal.storage.file.PackBitmapIndex; @@ -31,6 +34,7 @@ import org.eclipse.jgit.internal.storage.pack.PackOutputStream; import org.eclipse.jgit.internal.storage.pack.PackWriter; import org.eclipse.jgit.junit.JGitTestUtil; +import org.eclipse.jgit.junit.TestRepository; import org.eclipse.jgit.junit.TestRng; import org.eclipse.jgit.lib.BatchRefUpdate; import org.eclipse.jgit.lib.Constants; @@ -263,6 +267,27 @@ public void testBlockLoadCallback_loadInCache() throws IOException { assertEquals(2, tal.blockLoadCount); } + @Test + public void testExistenceOfBloomFilterAlongWithCommitGraph() + throws Exception { + try (TestRepository<InMemoryRepository> repository = new TestRepository<>( + db)) { + repository.branch("/refs/heads/main").commit().add("blob1", "blob1") + .create(); + } + setReadChangedPaths(true); + DfsGarbageCollector gc = new DfsGarbageCollector(db); + gc.setWriteCommitGraph(true).setWriteBloomFilter(true) + .pack(NullProgressMonitor.INSTANCE); + + DfsReader reader = db.getObjectDatabase().newReader(); + CommitGraph cg = db.getObjectDatabase().getPacks()[0] + .getCommitGraph(reader); + assertNotNull(cg); + assertEquals(1, cg.getCommitCnt()); + assertNotNull(cg.getChangedPathFilter(0)); + } + private ObjectId setupPack(int bs, int ps) throws IOException { DfsBlockCacheConfig cfg = new DfsBlockCacheConfig().setBlockSize(bs) .setBlockLimit(bs * 100).setStreamRatio(bypassCache ? 0F : 1F); @@ -298,4 +323,9 @@ private void setObjectSizeIndexMinBytes(int threshold) { db.getConfig().setInt(CONFIG_PACK_SECTION, null, CONFIG_KEY_MIN_BYTES_OBJ_SIZE_INDEX, threshold); } + + private void setReadChangedPaths(boolean enable) { + db.getConfig().setBoolean(CONFIG_COMMIT_GRAPH_SECTION, null, + CONFIG_KEY_READ_CHANGED_PATHS, enable); + } }
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsPackParserTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsPackParserTest.java index 845d5fc..130af27 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsPackParserTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsPackParserTest.java
@@ -46,10 +46,10 @@ public void parse_writeObjSizeIdx() throws IOException { .fromString("2e65efe2a145dda7ee51d1741299f848e5bf752e"); pack.header(2); - pack.write((Constants.OBJ_BLOB) << 4 | 1); + pack.write(Constants.OBJ_BLOB << 4 | 1); pack.deflate(new byte[] { 'a' }); - pack.write((Constants.OBJ_REF_DELTA) << 4 | 4); + pack.write(Constants.OBJ_REF_DELTA << 4 | 4); pack.copyRaw(blobA); pack.deflate(new byte[] { 0x1, 0x1, 0x1, 'b' }); pack.digest();
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcConcurrentTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcConcurrentTest.java index 96a0649..8c1b4f7 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcConcurrentTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcConcurrentTest.java
@@ -10,7 +10,6 @@ package org.eclipse.jgit.internal.storage.file; -import static java.lang.Integer.valueOf; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; @@ -73,7 +72,7 @@ public Integer call() throws Exception { try { gc.setProgressMonitor(this); gc.repack(); - return valueOf(0); + return Integer.valueOf(0); } catch (IOException e) { // leave the syncPoint in broken state so any awaiting // threads and any threads that call await in the future get @@ -84,7 +83,7 @@ public Integer call() throws Exception { } catch (InterruptedException ignored) { // } - return valueOf(1); + return Integer.valueOf(1); } } }
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcKeepFilesTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcKeepFilesTest.java index 9a2935f1..e1b6778 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcKeepFilesTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcKeepFilesTest.java
@@ -162,7 +162,7 @@ public void testKeptObjectsAreNotIncludedWhenPackKeptObjectsConfigIsFalse() private void testKeptObjectsAreIncluded() throws Exception { BranchBuilder bb = tr.branch("refs/heads/master"); ObjectId commitObjectInLockedPack = bb.commit().create().toObjectId(); - gc.gc(); + gc.gc().get(); stats = gc.getStatistics(); assertEquals(COMMIT_AND_TREE_OBJECTS, stats.numberOfPackedObjects); assertEquals(1, stats.numberOfPackFiles); @@ -170,7 +170,7 @@ private void testKeptObjectsAreIncluded() throws Exception { .createNewFile()); bb.commit().create(); - gc.gc(); + gc.gc().get(); stats = gc.getStatistics(); assertEquals(2 * COMMIT_AND_TREE_OBJECTS + 1, stats.numberOfPackedObjects); @@ -194,7 +194,7 @@ private void testKeptObjectsAreIncluded() throws Exception { private void testKeptObjectsAreNotIncluded() throws Exception { BranchBuilder bb = tr.branch("refs/heads/master"); ObjectId commitObjectInLockedPack = bb.commit().create().toObjectId(); - gc.gc(); + gc.gc().get(); stats = gc.getStatistics(); assertEquals(COMMIT_AND_TREE_OBJECTS, stats.numberOfPackedObjects); assertEquals(1, stats.numberOfPackFiles); @@ -202,7 +202,7 @@ private void testKeptObjectsAreNotIncluded() throws Exception { .createNewFile()); bb.commit().create(); - gc.gc(); + gc.gc().get(); stats = gc.getStatistics(); assertEquals(COMMIT_AND_TREE_OBJECTS + 1, stats.numberOfPackedObjects); assertEquals(2, stats.numberOfPackFiles);
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcSinceBitmapStatisticsTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcSinceBitmapStatisticsTest.java new file mode 100644 index 0000000..af52e2c --- /dev/null +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcSinceBitmapStatisticsTest.java
@@ -0,0 +1,190 @@ +/* + * Copyright (c) 2024 Jacek Centkowski <geminica.programs@gmail.com> and others. + * + * 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.internal.storage.file; + +import static org.junit.Assert.assertEquals; + +import java.io.IOException; +import java.nio.file.Files; +import java.util.Collection; +import java.util.stream.StreamSupport; + +import org.eclipse.jgit.internal.storage.file.GC.RepoStatistics; +import org.eclipse.jgit.lib.PersonIdent; +import org.eclipse.jgit.revwalk.RevCommit; +import org.eclipse.jgit.storage.pack.PackConfig; +import org.junit.Test; + +public class GcSinceBitmapStatisticsTest extends GcTestCase { + @Test + public void testShouldReportZeroPacksAndObjectsForInitializedRepo() + throws IOException { + RepoStatistics s = gc.getStatistics(); + assertEquals(0L, s.numberOfPackFilesSinceBitmap); + assertEquals(0L, s.numberOfObjectsSinceBitmap); + } + + @Test + public void testShouldReportAllPackFilesWhenNoGcWasPerformed() + throws Exception { + tr.packAndPrune(); + long result = gc.getStatistics().numberOfPackFilesSinceBitmap; + + assertEquals(repo.getObjectDatabase().getPacks().size(), result); + } + + @Test + public void testShouldReportAllObjectsWhenNoGcWasPerformed() + throws Exception { + tr.packAndPrune(); + + assertEquals( + getNumberOfObjectsInPacks(repo.getObjectDatabase().getPacks()), + gc.getStatistics().numberOfObjectsSinceBitmap); + } + + @Test + public void testShouldReportNoPacksFilesSinceBitmapWhenPackfilesAreOlderThanBitmapFile() + throws Exception { + addCommit(null); + configureGC(/* buildBitmap */ false).gc().get(); + assertEquals(1L, gc.getStatistics().numberOfPackFiles); + assertEquals(0L, repositoryBitmapFiles()); + assertEquals(1L, gc.getStatistics().numberOfPackFilesSinceBitmap); + + addCommit(null); + configureGC(/* buildBitmap */ true).gc().get(); + + assertEquals(1L, repositoryBitmapFiles()); + assertEquals(2L, gc.getStatistics().numberOfPackFiles); + assertEquals(0L, gc.getStatistics().numberOfPackFilesSinceBitmap); + } + + @Test + public void testShouldReportNoObjectsDirectlyAfterGc() throws Exception { + // given + addCommit(null); + assertEquals(2L, gc.getStatistics().numberOfObjectsSinceBitmap); + + gc.gc().get(); + assertEquals(0L, gc.getStatistics().numberOfObjectsSinceBitmap); + } + + @Test + public void testShouldReportNewPacksSinceGcWhenRepositoryProgresses() + throws Exception { + // commit & gc + RevCommit parent = addCommit(null); + gc.gc().get(); + assertEquals(1L, repositoryBitmapFiles()); + + // progress & pack + addCommit(parent); + assertEquals(1L, gc.getStatistics().numberOfPackFiles); + assertEquals(0L, gc.getStatistics().numberOfPackFilesSinceBitmap); + + tr.packAndPrune(); + assertEquals(2L, gc.getStatistics().numberOfPackFiles); + assertEquals(1L, gc.getStatistics().numberOfPackFilesSinceBitmap); + } + + @Test + public void testShouldReportNewObjectsSinceGcWhenRepositoryProgresses() + throws Exception { + // commit & gc + RevCommit parent = addCommit(null); + gc.gc().get(); + assertEquals(0L, gc.getStatistics().numberOfLooseObjects); + assertEquals(0L, gc.getStatistics().numberOfObjectsSinceBitmap); + + // progress & pack + addCommit(parent); + assertEquals(1L, gc.getStatistics().numberOfLooseObjects); + assertEquals(1L, gc.getStatistics().numberOfObjectsSinceBitmap); + + tr.packAndPrune(); + assertEquals(0L, gc.getStatistics().numberOfLooseObjects); + // Number of objects contained in the newly created PackFile + assertEquals(3L, gc.getStatistics().numberOfObjectsSinceBitmap); + } + + @Test + public void testShouldReportNewPacksFromTheLatestBitmapWhenRepositoryProgresses() + throws Exception { + // commit & gc + RevCommit parent = addCommit(null); + gc.gc().get(); + assertEquals(1L, repositoryBitmapFiles()); + + // progress & gc + parent = addCommit(parent); + gc.gc().get(); + assertEquals(2L, repositoryBitmapFiles()); + + // progress & pack + addCommit(parent); + tr.packAndPrune(); + + assertEquals(1L, gc.getStatistics().numberOfPackFilesSinceBitmap); + } + + @Test + public void testShouldReportNewObjectsFromTheLatestBitmapWhenRepositoryProgresses() + throws Exception { + // commit & gc + RevCommit parent = addCommit(null); + gc.gc().get(); + + // progress & gc + parent = addCommit(parent); + gc.gc().get(); + assertEquals(0L, gc.getStatistics().numberOfObjectsSinceBitmap); + + // progress & pack + addCommit(parent); + assertEquals(1L, gc.getStatistics().numberOfObjectsSinceBitmap); + + tr.packAndPrune(); + assertEquals(4L, gc.getStatistics().numberOfObjectsSinceBitmap); + } + + private RevCommit addCommit(RevCommit parent) throws Exception { + return tr.branch("master").commit() + .author(new PersonIdent("repo-metrics", "repo@metrics.com")) + .parent(parent).create(); + } + + private long repositoryBitmapFiles() throws IOException { + return StreamSupport + .stream(Files + .newDirectoryStream(repo.getObjectDatabase() + .getPackDirectory().toPath(), "pack-*.bitmap") + .spliterator(), false) + .count(); + } + + private long getNumberOfObjectsInPacks(Collection<Pack> packs) { + return packs.stream().mapToLong(pack -> { + try { + return pack.getObjectCount(); + } catch (IOException e) { + throw new RuntimeException(e); + } + }).sum(); + } + + private GC configureGC(boolean buildBitmap) { + PackConfig pc = new PackConfig(repo.getObjectDatabase().getConfig()); + pc.setBuildBitmaps(buildBitmap); + gc.setPackConfig(pc); + return gc; + } +}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/LockFileTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/LockFileTest.java index 7eab1dc..953d624bf 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/LockFileTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/LockFileTest.java
@@ -209,7 +209,8 @@ public void testUnlockNoop() throws Exception { lock.unlock(); lock.unlock(); } catch (Throwable e) { - fail("unlock should be noop if not locked at all."); + throw new AssertionError( + "unlock should be noop if not locked at all.", e); } } }
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefUpdateTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefUpdateTest.java index 28d5ca7..cb977bd 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefUpdateTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefUpdateTest.java
@@ -513,7 +513,6 @@ public void testUpdateRefNoChange() throws IOException { @Test public void testRefsCacheAfterUpdate() throws Exception { // Do not use the default repo for this case. - List<Ref> allRefs = db.getRefDatabase().getRefs(); ObjectId oldValue = db.resolve("HEAD"); ObjectId newValue = db.resolve("HEAD^"); // first make HEAD refer to loose ref @@ -529,7 +528,7 @@ public void testRefsCacheAfterUpdate() throws Exception { update = updateRef.update(); assertEquals(Result.FAST_FORWARD, update); - allRefs = db.getRefDatabase().getRefs(); + List<Ref> allRefs = db.getRefDatabase().getRefs(); Ref master = getRef(allRefs, "refs/heads/master").get(); Ref head = getRef(allRefs, "HEAD").get(); assertEquals("refs/heads/master", master.getName()); @@ -550,7 +549,6 @@ public void testRefsCacheAfterUpdate() throws Exception { @Test public void testRefsCacheAfterUpdateLooseOnly() throws Exception { // Do not use the default repo for this case. - List<Ref> allRefs = db.getRefDatabase().getRefs(); ObjectId oldValue = db.resolve("HEAD"); writeSymref(Constants.HEAD, "refs/heads/newref"); RefUpdate updateRef = db.updateRef(Constants.HEAD); @@ -559,7 +557,7 @@ public void testRefsCacheAfterUpdateLooseOnly() throws Exception { Result update = updateRef.update(); assertEquals(Result.NEW, update); - allRefs = db.getRefDatabase().getRefs(); + List<Ref> allRefs = db.getRefDatabase().getRefs(); Ref head = getRef(allRefs, "HEAD").get(); Ref newref = getRef(allRefs, "refs/heads/newref").get(); assertEquals("refs/heads/newref", newref.getName());
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/pack/GcCommitSelectionTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/pack/GcCommitSelectionTest.java index 0c09ad1..ecf9a15 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/pack/GcCommitSelectionTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/pack/GcCommitSelectionTest.java
@@ -110,7 +110,7 @@ public void testBitmapDoesNotIncludeAnnotatedTags() throws Exception { tr.branch(mainBranch).update(commit1); gc.setExpireAgeMillis(0); - gc.gc(); + gc.gc().get(); // Create only 2 bitmaps, for commit0 and commit1, excluding commit2 assertEquals(2, gc.getStatistics().numberOfBitmaps); @@ -227,7 +227,7 @@ public void testBitmapsForExcludedBranches() throws Exception { PackConfig packConfig = new PackConfig(); packConfig.setBitmapExcludedRefsPrefixes(new String[] { "refs/heads/other" }); gc.setPackConfig(packConfig); - gc.gc(); + gc.gc().get(); assertEquals(1, gc.getStatistics().numberOfBitmaps); }
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java index 0c0257d..31940a1 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java
@@ -42,7 +42,6 @@ import java.util.Arrays; import java.util.Collections; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.Set; import java.util.concurrent.TimeUnit; @@ -124,16 +123,16 @@ public void test004_PutGetSimple() { @Test public void test005_PutGetStringList() { Config c = new Config(); - final LinkedList<String> values = new LinkedList<>(); + List<String> values = new ArrayList<>(); values.add("value1"); values.add("value2"); c.setStringList("my", null, "somename", values); - final Object[] expArr = values.toArray(); - final String[] actArr = c.getStringList("my", null, "somename"); + Object[] expArr = values.toArray(); + String[] actArr = c.getStringList("my", null, "somename"); assertArrayEquals(expArr, actArr); - final String expText = "[my]\n\tsomename = value1\n\tsomename = value2\n"; + String expText = "[my]\n\tsomename = value1\n\tsomename = value2\n"; assertEquals(expText, c.toText()); } @@ -1568,7 +1567,6 @@ public void testCommitTemplateConfigRelativePath() @Test public void testCommitTemplateEncoding() throws ConfigInvalidException, IOException { - Config config = new Config(null); File workTree = tmp.newFolder("dummy-worktree"); Repository repo = FileRepositoryBuilder .create(new File(workTree, ".git")); @@ -1577,7 +1575,7 @@ public void testCommitTemplateEncoding() String templateContent = "content of the template"; JGitTestUtil.write(tempFile, templateContent); String expectedTemplatePath = tempFile.getPath(); - config = parse("[i18n]\n\tcommitEncoding = utf-8\n" + Config config = parse("[i18n]\n\tcommitEncoding = utf-8\n" + "[commit]\n\ttemplate = " + Config.escapeValue(expectedTemplatePath) + "\n"); assertEquals(templateContent, @@ -1591,7 +1589,6 @@ public void testCommitTemplateEncoding() @Test(expected = ConfigInvalidException.class) public void testCommitTemplateWithInvalidEncoding() throws ConfigInvalidException, IOException { - Config config = new Config(null); File workTree = tmp.newFolder("dummy-worktree"); File tempFile = tmp.newFile("testCommitTemplate-"); Repository repo = FileRepositoryBuilder @@ -1599,7 +1596,7 @@ public void testCommitTemplateWithInvalidEncoding() repo.create(); String templateContent = "content of the template"; JGitTestUtil.write(tempFile, templateContent); - config = parse("[i18n]\n\tcommitEncoding = invalidEcoding\n" + Config config = parse("[i18n]\n\tcommitEncoding = invalidEcoding\n" + "[commit]\n\ttemplate = " + Config.escapeValue(tempFile.getPath()) + "\n"); config.get(CommitConfig.KEY).getCommitTemplateContent(repo); @@ -1608,7 +1605,6 @@ public void testCommitTemplateWithInvalidEncoding() @Test(expected = FileNotFoundException.class) public void testCommitTemplateWithInvalidPath() throws ConfigInvalidException, IOException { - Config config = new Config(null); File workTree = tmp.newFolder("dummy-worktree"); File tempFile = tmp.newFile("testCommitTemplate-"); Repository repo = FileRepositoryBuilder @@ -1618,7 +1614,8 @@ public void testCommitTemplateWithInvalidPath() JGitTestUtil.write(tempFile, templateContent); // commit message encoding String expectedTemplatePath = "~/nonExistingTemplate"; - config = parse("[commit]\n\ttemplate = " + expectedTemplatePath + "\n"); + Config config = parse( + "[commit]\n\ttemplate = " + expectedTemplatePath + "\n"); String templatePath = config.get(CommitConfig.KEY) .getCommitTemplatePath(); assertEquals(expectedTemplatePath, templatePath);
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectCheckerTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectCheckerTest.java index 5c44c9c..3ec4b6a 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectCheckerTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectCheckerTest.java
@@ -11,7 +11,6 @@ package org.eclipse.jgit.lib; -import static java.lang.Integer.valueOf; import static java.nio.charset.StandardCharsets.UTF_8; import static org.eclipse.jgit.junit.JGitTestUtil.concat; import static org.eclipse.jgit.lib.Constants.OBJECT_ID_LENGTH; @@ -92,7 +91,7 @@ public void setUp() throws Exception { public void testInvalidType() { String msg = MessageFormat.format( JGitText.get().corruptObjectInvalidType2, - valueOf(OBJ_BAD)); + Integer.valueOf(OBJ_BAD)); assertCorrupt(msg, OBJ_BAD, new byte[0]); }
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RacyGitTests.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RacyGitTests.java index b1d80c5..f25e5d1 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RacyGitTests.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RacyGitTests.java
@@ -30,6 +30,22 @@ public class RacyGitTests extends RepositoryTestCase { + /** + * This test is inherently flaky in nature since using clocks in a computer + * to determine file modifications in a filesystem from Java is difficult + * and depends on many factors and we can't test all combinations + * + * If this test fails on your computer, don't worry but let us know if you + * are willing to provide details which may help to further improve handling + * of the racy git problem in JGit. + * + * Despite not being completely reproducible this test is still useful to + * detect regressions when running this test repeatedly on the same + * OS/filesystem/Java version (which we do on the CI used to build JGit). + * + * @see "https://git-scm.com/docs/racy-git" + * @see "https://www.youtube.com/watch?v=m44cAozuLNI" + */ @Test public void testRacyGitDetection() throws Exception { // Reset to force creation of index file
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ThreadSafeProgressMonitorTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ThreadSafeProgressMonitorTest.java index e21ff58..a5a6ce5 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ThreadSafeProgressMonitorTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ThreadSafeProgressMonitorTest.java
@@ -125,7 +125,7 @@ private static void await(CountDownLatch cdl) { try { assertTrue("latch released", cdl.await(1000, TimeUnit.MILLISECONDS)); } catch (InterruptedException ie) { - fail("Did not expect to be interrupted"); + throw new AssertionError("Did not expect to be interrupted", ie); } }
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeAlgorithmTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeAlgorithmTest.java index 680a2d5..7a8a93e 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeAlgorithmTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeAlgorithmTest.java
@@ -162,6 +162,19 @@ public void testModificationsWithMiddleDelete() throws IOException { merge("abz}z}z123q", "Abz}z123Q", "abz}z123q", true)); } + @Test + public void testInsertionAfterDeletion() throws IOException { + assertEquals(t("a<=bc>d"), merge("abd", "ad", "abcd", false)); + assertEquals(t("a<|b=bc>d"), + merge("abd", "ad", "abcd", true)); + } + + @Test + public void testInsertionBeforeDeletion() throws IOException { + assertEquals(t("a<=cb>d"), merge("abd", "ad", "acbd", false)); + assertEquals(t("a<|b=cb>d"), merge("abd", "ad", "acbd", true)); + } + /** * Test a conflicting region at the very start of the text. *
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeAlgorithmUnionTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeAlgorithmUnionTest.java new file mode 100644 index 0000000..3a8af7a --- /dev/null +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeAlgorithmUnionTest.java
@@ -0,0 +1,328 @@ +/* + * Copyright (C) 2024 Qualcomm Innovation Center, Inc. + * + * 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.merge; + +import static java.nio.charset.StandardCharsets.UTF_8; +import static org.junit.Assert.assertEquals; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; + +import org.eclipse.jgit.diff.RawText; +import org.eclipse.jgit.diff.RawTextComparator; +import org.eclipse.jgit.lib.Constants; +import org.junit.Assume; +import org.junit.Test; +import org.junit.experimental.theories.DataPoints; +import org.junit.experimental.theories.Theories; +import org.junit.runner.RunWith; + +@RunWith(Theories.class) +public class MergeAlgorithmUnionTest { + MergeFormatter fmt = new MergeFormatter(); + + private final boolean newlineAtEnd; + + @DataPoints + public static boolean[] newlineAtEndDataPoints = { false, true }; + + public MergeAlgorithmUnionTest(boolean newlineAtEnd) { + this.newlineAtEnd = newlineAtEnd; + } + + /** + * Check for a conflict where the second text was changed similar to the + * first one, but the second texts modification covers one more line. + * + * @throws java.io.IOException + */ + @Test + public void testTwoConflictingModifications() throws IOException { + assertEquals(t("abZZdefghij"), + merge("abcdefghij", "abZdefghij", "aZZdefghij")); + } + + /** + * Test a case where we have three consecutive chunks. The first text + * modifies all three chunks. The second text modifies the first and the + * last chunk. This should be reported as one conflicting region. + * + * @throws java.io.IOException + */ + @Test + public void testOneAgainstTwoConflictingModifications() throws IOException { + assertEquals(t("aZZcZefghij"), + merge("abcdefghij", "aZZZefghij", "aZcZefghij")); + } + + /** + * Test a merge where only the second text contains modifications. Expect as + * merge result the second text. + * + * @throws java.io.IOException + */ + @Test + public void testNoAgainstOneModification() throws IOException { + assertEquals(t("aZcZefghij"), + merge("abcdefghij", "abcdefghij", "aZcZefghij")); + } + + /** + * Both texts contain modifications but not on the same chunks. Expect a + * non-conflict merge result. + * + * @throws java.io.IOException + */ + @Test + public void testTwoNonConflictingModifications() throws IOException { + assertEquals(t("YbZdefghij"), + merge("abcdefghij", "abZdefghij", "Ybcdefghij")); + } + + /** + * Merge two complicated modifications. The merge algorithm has to extend + * and combine conflicting regions to get to the expected merge result. + * + * @throws java.io.IOException + */ + @Test + public void testTwoComplicatedModifications() throws IOException { + assertEquals(t("aZZZZfZhZjbYdYYYYiY"), + merge("abcdefghij", "aZZZZfZhZj", "abYdYYYYiY")); + } + + /** + * Merge two modifications with a shared delete at the end. The underlying + * diff algorithm has to provide consistent edit results to get the expected + * merge result. + * + * @throws java.io.IOException + */ + @Test + public void testTwoModificationsWithSharedDelete() throws IOException { + assertEquals(t("Cb}n}"), merge("ab}n}n}", "ab}n}", "Cb}n}")); + } + + /** + * Merge modifications with a shared insert in the middle. The underlying + * diff algorithm has to provide consistent edit results to get the expected + * merge result. + * + * @throws java.io.IOException + */ + @Test + public void testModificationsWithMiddleInsert() throws IOException { + assertEquals(t("aBcd123123uvwxPq"), + merge("abcd123uvwxpq", "aBcd123123uvwxPq", "abcd123123uvwxpq")); + } + + /** + * Merge modifications with a shared delete in the middle. The underlying + * diff algorithm has to provide consistent edit results to get the expected + * merge result. + * + * @throws java.io.IOException + */ + @Test + public void testModificationsWithMiddleDelete() throws IOException { + assertEquals(t("Abz}z123Q"), + merge("abz}z}z123q", "Abz}z123Q", "abz}z123q")); + } + + @Test + public void testInsertionAfterDeletion() throws IOException { + assertEquals(t("abcd"), merge("abd", "ad", "abcd")); + } + + @Test + public void testInsertionBeforeDeletion() throws IOException { + assertEquals(t("acbd"), merge("abd", "ad", "acbd")); + } + + /** + * Test a conflicting region at the very start of the text. + * + * @throws java.io.IOException + */ + @Test + public void testConflictAtStart() throws IOException { + assertEquals(t("ZYbcdefghij"), + merge("abcdefghij", "Zbcdefghij", "Ybcdefghij")); + } + + /** + * Test a conflicting region at the very end of the text. + * + * @throws java.io.IOException + */ + @Test + public void testConflictAtEnd() throws IOException { + assertEquals(t("abcdefghiZY"), + merge("abcdefghij", "abcdefghiZ", "abcdefghiY")); + } + + /** + * Check for a conflict where the second text was changed similar to the + * first one, but the second texts modification covers one more line. + * + * @throws java.io.IOException + */ + @Test + public void testSameModification() throws IOException { + assertEquals(t("abZdefghij"), + merge("abcdefghij", "abZdefghij", "abZdefghij")); + } + + /** + * Check that a deleted vs. a modified line shows up as conflict (see Bug + * 328551) + * + * @throws java.io.IOException + */ + @Test + public void testDeleteVsModify() throws IOException { + assertEquals(t("abZdefghij"), + merge("abcdefghij", "abdefghij", "abZdefghij")); + } + + @Test + public void testInsertVsModify() throws IOException { + assertEquals(t("abZXY"), merge("ab", "abZ", "aXY")); + } + + @Test + public void testAdjacentModifications() throws IOException { + assertEquals(t("aZcbYd"), merge("abcd", "aZcd", "abYd")); + } + + @Test + public void testSeparateModifications() throws IOException { + assertEquals(t("aZcYe"), merge("abcde", "aZcde", "abcYe")); + } + + @Test + public void testBlankLines() throws IOException { + assertEquals(t("aZc\nYe"), merge("abc\nde", "aZc\nde", "abc\nYe")); + } + + /** + * Test merging two contents which do one similar modification and one + * insertion is only done by one side, in the middle. Between modification + * and insertion is a block which is common between the two contents and the + * common base + * + * @throws java.io.IOException + */ + @Test + public void testTwoSimilarModsAndOneInsert() throws IOException { + assertEquals(t("aBcDde"), merge("abcde", "aBcde", "aBcDde")); + + assertEquals(t("IAAAJCAB"), merge("iACAB", "IACAB", "IAAAJCAB")); + + assertEquals(t("HIAAAJCAB"), merge("HiACAB", "HIACAB", "HIAAAJCAB")); + + assertEquals(t("AGADEFHIAAAJCAB"), + merge("AGADEFHiACAB", "AGADEFHIACAB", "AGADEFHIAAAJCAB")); + } + + /** + * Test merging two contents which do one similar modification and one + * insertion is only done by one side, at the end. Between modification and + * insertion is a block which is common between the two contents and the + * common base + * + * @throws java.io.IOException + */ + @Test + public void testTwoSimilarModsAndOneInsertAtEnd() throws IOException { + Assume.assumeTrue(newlineAtEnd); + assertEquals(t("IAAJ"), merge("iA", "IA", "IAAJ")); + + assertEquals(t("IAJ"), merge("iA", "IA", "IAJ")); + + assertEquals(t("IAAAJ"), merge("iA", "IA", "IAAAJ")); + } + + @Test + public void testTwoSimilarModsAndOneInsertAtEndNoNewlineAtEnd() + throws IOException { + Assume.assumeFalse(newlineAtEnd); + assertEquals(t("IAAAJ"), merge("iA", "IA", "IAAJ")); + + assertEquals(t("IAAJ"), merge("iA", "IA", "IAJ")); + + assertEquals(t("IAAAAJ"), merge("iA", "IA", "IAAAJ")); + } + + // Test situations where (at least) one input value is the empty text + + @Test + public void testEmptyTextModifiedAgainstDeletion() throws IOException { + // NOTE: git.git merge-file appends a '\n' to the end of the file even + // when the input files do not have a newline at the end. That appears + // to be a bug in git.git. + assertEquals(t("AB"), merge("A", "AB", "")); + assertEquals(t("AB"), merge("A", "", "AB")); + } + + @Test + public void testEmptyTextUnmodifiedAgainstDeletion() throws IOException { + assertEquals(t(""), merge("AB", "AB", "")); + + assertEquals(t(""), merge("AB", "", "AB")); + } + + @Test + public void testEmptyTextDeletionAgainstDeletion() throws IOException { + assertEquals(t(""), merge("AB", "", "")); + } + + private String merge(String commonBase, String ours, String theirs) + throws IOException { + MergeAlgorithm ma = new MergeAlgorithm(); + ma.setContentMergeStrategy(ContentMergeStrategy.UNION); + MergeResult<RawText> r = ma.merge(RawTextComparator.DEFAULT, + T(commonBase), T(ours), T(theirs)); + ByteArrayOutputStream bo = new ByteArrayOutputStream(50); + fmt.formatMerge(bo, r, "B", "O", "T", UTF_8); + return bo.toString(UTF_8); + } + + public String t(String text) { + StringBuilder r = new StringBuilder(); + for (int i = 0; i < text.length(); i++) { + char c = text.charAt(i); + switch (c) { + case '<': + r.append("<<<<<<< O\n"); + break; + case '=': + r.append("=======\n"); + break; + case '|': + r.append("||||||| B\n"); + break; + case '>': + r.append(">>>>>>> T\n"); + break; + default: + r.append(c); + if (newlineAtEnd || i < text.length() - 1) + r.append('\n'); + } + } + return r.toString(); + } + + public RawText T(String text) { + return new RawText(Constants.encode(t(text))); + } +}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergerTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergerTest.java index 022e8cd..3a036ac 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergerTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergerTest.java
@@ -22,9 +22,12 @@ import java.io.File; import java.io.FileInputStream; import java.io.IOException; +import java.nio.file.Files; import java.time.Instant; import java.util.Arrays; +import java.util.HashSet; import java.util.Map; +import java.util.Set; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.MergeResult; @@ -51,6 +54,7 @@ import org.eclipse.jgit.lib.ObjectLoader; import org.eclipse.jgit.lib.ObjectReader; import org.eclipse.jgit.lib.ObjectStream; +import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.StoredConfig; import org.eclipse.jgit.merge.ResolveMerger.MergeFailureReason; import org.eclipse.jgit.revwalk.RevCommit; @@ -1442,6 +1446,8 @@ public void checkMergeConflictInVirtualAncestor( git.checkout().setName("master").call(); mergeResult = git.merge().include(commitX).setStrategy(strategy) .call(); + assertEquals(MergeResult.MergeStatus.MERGED, + mergeResult.getMergeStatus()); // Now, merge commit A and B (i.e. "master" and "second-branch"). // None of them have the file "a", so there is no conflict, BUT while @@ -1735,25 +1741,25 @@ public void checkModeMergeConflictInVirtualAncestor(MergeStrategy strategy) thro git.add().addFilepattern("c").call(); RevCommit commitI = git.commit().setMessage("Initial commit").call(); - File a = writeTrashFile("a", "content in Ancestor"); + writeTrashFile("a", "content in Ancestor"); git.add().addFilepattern("a").call(); RevCommit commitA1 = git.commit().setMessage("Ancestor 1").call(); - a = writeTrashFile("a", "content in Child 1 (commited on master)"); + writeTrashFile("a", "content in Child 1 (commited on master)"); git.add().addFilepattern("a").call(); // commit C1M git.commit().setMessage("Child 1 on master").call(); git.checkout().setCreateBranch(true).setStartPoint(commitI).setName("branch-to-merge").call(); // "a" becomes executable in A2 - a = writeTrashFile("a", "content in Ancestor"); + File a = writeTrashFile("a", "content in Ancestor"); a.setExecutable(true); git.add().addFilepattern("a").call(); RevCommit commitA2 = git.commit().setMessage("Ancestor 2").call(); // second branch git.checkout().setCreateBranch(true).setStartPoint(commitA1).setName("second-branch").call(); - a = writeTrashFile("a", "content in Child 2 (commited on second-branch)"); + writeTrashFile("a", "content in Child 2 (commited on second-branch)"); git.add().addFilepattern("a").call(); // commit C2S git.commit().setMessage("Child 2 on second-branch").call(); @@ -1789,6 +1795,188 @@ public void checkModeMergeConflictInVirtualAncestor(MergeStrategy strategy) thro } + /** + * File is binary in ours, theirs and base with different content in each of + * them. Content of the file should not change after the merge conflict as + * no conflict markers are added to the binary files + */ + @Theory + public void oursBinaryTheirsBinaryBaseBinary(MergeStrategy strategy) + throws Exception { + Git git = Git.wrap(db); + String binaryFile = "file"; + + writeTrashFile(binaryFile, "\u0000\u0001"); + git.add().addFilepattern(binaryFile).call(); + RevCommit parent = git.commit().setMessage("BASE COMMIT").call(); + String fileHashInBase = getFileHashInWorkTree(git, binaryFile); + + writeTrashFile(binaryFile, "\u0001\u0002"); + git.add().addFilepattern(binaryFile).call(); + RevCommit child1 = git.commit().setMessage("THEIRS COMMIT").call(); + String fileHashInChild1 = getFileHashInWorkTree(git, binaryFile); + + git.checkout().setCreateBranch(true).setStartPoint(parent) + .setName("side").call(); + + writeTrashFile(binaryFile, "\u0002\u0000"); + git.add().addFilepattern(binaryFile).call(); + git.commit().setMessage("OURS COMMIT").call(); + String fileHashInChild2 = getFileHashInWorkTree(git, binaryFile); + + MergeResult mergeResult = git.merge().setStrategy(strategy) + .include(child1).call(); + + // check if the merge caused a conflict + assertTrue(mergeResult.getConflicts() != null + && !mergeResult.getConflicts().isEmpty()); + String fileHashInChild2AfterMerge = getFileHashInWorkTree(git, + binaryFile); + + // check if the file content changed during a conflicting merge + assertEquals(fileHashInChild2AfterMerge, fileHashInChild2); + + Set<String> hashesInIndexFile = new HashSet<>(); + DirCache indexContent = git.getRepository().readDirCache(); + for (int i = 0; i < indexContent.getEntryCount(); ++i) { + DirCacheEntry indexEntry = indexContent.getEntry(i); + if (binaryFile.equals(indexEntry.getPathString())) { + hashesInIndexFile.add(indexEntry.getObjectId().name()); + } + } + + // check if all the three stages are added to index file + assertTrue(hashesInIndexFile.contains(fileHashInBase)); + assertTrue(hashesInIndexFile.contains(fileHashInChild1)); + assertTrue(hashesInIndexFile.contains(fileHashInChild2)); + } + + /** + * File is text in ours and theirs with different content but binary in + * base. Even in this case, file will be treated as a binary and no conflict + * markers are added to it + */ + @Theory + public void oursAndTheirsDifferentTextBaseBinary(MergeStrategy strategy) + throws Exception { + Git git = Git.wrap(db); + String binaryFile = "file"; + + writeTrashFile(binaryFile, "\u0000\u0001"); + git.add().addFilepattern(binaryFile).call(); + RevCommit parent = git.commit().setMessage("BASE COMMIT").call(); + String fileHashInBase = getFileHashInWorkTree(git, binaryFile); + + writeTrashFile(binaryFile, "TEXT1"); + git.add().addFilepattern(binaryFile).call(); + RevCommit child1 = git.commit().setMessage("THEIRS COMMIT").call(); + String fileHashInChild1 = getFileHashInWorkTree(git, binaryFile); + + git.checkout().setCreateBranch(true).setStartPoint(parent) + .setName("side").call(); + + writeTrashFile(binaryFile, "TEXT2"); + git.add().addFilepattern(binaryFile).call(); + git.commit().setMessage("OURS COMMIT").call(); + String fileHashInChild2 = getFileHashInWorkTree(git, binaryFile); + + MergeResult mergeResult = git.merge().setStrategy(strategy) + .include(child1).call(); + + assertTrue(mergeResult.getConflicts() != null + && !mergeResult.getConflicts().isEmpty()); + String fileHashInChild2AfterMerge = getFileHashInWorkTree(git, + binaryFile); + + assertEquals(fileHashInChild2AfterMerge, fileHashInChild2); + + Set<String> hashesInIndexFile = new HashSet<>(); + DirCache indexContent = git.getRepository().readDirCache(); + for (int i = 0; i < indexContent.getEntryCount(); ++i) { + DirCacheEntry indexEntry = indexContent.getEntry(i); + if (binaryFile.equals(indexEntry.getPathString())) { + hashesInIndexFile.add(indexEntry.getObjectId().name()); + } + } + + assertTrue(hashesInIndexFile.contains(fileHashInBase)); + assertTrue(hashesInIndexFile.contains(fileHashInChild1)); + assertTrue(hashesInIndexFile.contains(fileHashInChild2)); + } + + /** + * Tests the scenario where a file is expected to be treated as binary + * according to Git attributes + */ + @Theory + public void fileInBinaryInAttribute(MergeStrategy strategy) + throws Exception { + Git git = Git.wrap(db); + String binaryFile = "file.bin"; + + writeTrashFile(".gitattributes", binaryFile + " binary"); + git.add().addFilepattern(".gitattributes").call(); + git.commit().setMessage("ADDING GITATTRIBUTES").call(); + + writeTrashFile(binaryFile, "\u0000\u0001"); + git.add().addFilepattern(binaryFile).call(); + RevCommit parent = git.commit().setMessage("BASE COMMIT").call(); + String fileHashInBase = getFileHashInWorkTree(git, binaryFile); + + writeTrashFile(binaryFile, "\u0001\u0002"); + git.add().addFilepattern(binaryFile).call(); + RevCommit child1 = git.commit().setMessage("THEIRS COMMIT").call(); + String fileHashInChild1 = getFileHashInWorkTree(git, binaryFile); + + git.checkout().setCreateBranch(true).setStartPoint(parent) + .setName("side").call(); + + writeTrashFile(binaryFile, "\u0002\u0000"); + git.add().addFilepattern(binaryFile).call(); + git.commit().setMessage("OURS COMMIT").call(); + String fileHashInChild2 = getFileHashInWorkTree(git, binaryFile); + + MergeResult mergeResult = git.merge().setStrategy(strategy) + .include(child1).call(); + + // check if the merge caused a conflict + assertTrue(mergeResult.getConflicts() != null + && !mergeResult.getConflicts().isEmpty()); + String fileHashInChild2AfterMerge = getFileHashInWorkTree(git, + binaryFile); + + // check if the file content changed during a conflicting merge + assertEquals(fileHashInChild2AfterMerge, fileHashInChild2); + + Set<String> hashesInIndexFile = new HashSet<>(); + DirCache indexContent = git.getRepository().readDirCache(); + for (int i = 0; i < indexContent.getEntryCount(); ++i) { + DirCacheEntry indexEntry = indexContent.getEntry(i); + if (binaryFile.equals(indexEntry.getPathString())) { + hashesInIndexFile.add(indexEntry.getObjectId().name()); + } + } + + // check if all the three stages are added to index file + assertTrue(hashesInIndexFile.contains(fileHashInBase)); + assertTrue(hashesInIndexFile.contains(fileHashInChild1)); + assertTrue(hashesInIndexFile.contains(fileHashInChild2)); + } + + private String getFileHashInWorkTree(Git git, String filePath) + throws IOException { + Repository repository = git.getRepository(); + ObjectInserter objectInserter = repository.newObjectInserter(); + + File conflictingFile = new File(repository.getWorkTree(), filePath); + byte[] fileContent = Files.readAllBytes(conflictingFile.toPath()); + ObjectId blobId = objectInserter.insert(Constants.OBJ_BLOB, + fileContent); + objectInserter.flush(); + + return blobId.name(); + } + private void writeSubmodule(String path, ObjectId commit) throws IOException, ConfigInvalidException { addSubmoduleToIndex(path, commit);
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/PatchApplierTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/PatchApplierTest.java index 2aac15b..5507f85 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/PatchApplierTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/PatchApplierTest.java
@@ -48,8 +48,7 @@ import org.junit.runners.Suite; @RunWith(Suite.class) -@Suite.SuiteClasses({ - PatchApplierTest.WithWorktree. class, // +@Suite.SuiteClasses({ PatchApplierTest.WithWorktree.class, // PatchApplierTest.InCore.class, // }) public class PatchApplierTest { @@ -128,6 +127,20 @@ protected Result applyPatch() throws IOException { } } + protected Result applyPatchAllowConflicts() throws IOException { + InputStream patchStream = getTestResource(name + ".patch"); + Patch patch = new Patch(); + patch.parse(patchStream); + if (inCore) { + try (ObjectInserter oi = db.newObjectInserter()) { + return new PatchApplier(db, baseTip, oi).allowConflicts() + .applyPatch(patch); + } + } + return new PatchApplier(db).allowConflicts() + .applyPatch(patch); + } + protected static InputStream getTestResource(String patchFile) { return PatchApplierTest.class.getClassLoader() .getResourceAsStream("org/eclipse/jgit/diff/" + patchFile); @@ -169,6 +182,13 @@ void verifyChange(Result result, String aName, boolean exists) verifyContent(result, aName, exists); } + void verifyChange(Result result, String aName, boolean exists, + int numConflicts) throws Exception { + assertEquals(numConflicts, result.getErrors().size()); + assertEquals(1, result.getPaths().size()); + verifyContent(result, aName, exists); + } + protected byte[] readBlob(ObjectId treeish, String path) throws Exception { try (TestRepository<?> tr = new TestRepository<>(db); @@ -346,6 +366,44 @@ public void testCopyWithHunks() throws Exception { } @Test + public void testConflictMarkers() throws Exception { + init("allowconflict", true, true); + + Result result = applyPatchAllowConflicts(); + + assertEquals(result.getErrors().size(), 1); + PatchApplier.Result.Error error = result.getErrors().get(0); + assertEquals("cannot apply hunk", error.msg); + assertEquals("allowconflict", error.oldFileName); + assertTrue(error.isGitConflict()); + verifyChange(result, "allowconflict", true, 1); + } + + @Test + public void testConflictMarkersOutOfBounds() throws Exception { + init("ConflictOutOfBounds", true, true); + + Result result = applyPatchAllowConflicts(); + + assertEquals(result.getErrors().size(), 1); + PatchApplier.Result.Error error = result.getErrors().get(0); + assertEquals("cannot apply hunk", error.msg); + assertEquals("ConflictOutOfBounds", error.oldFileName); + assertTrue(error.isGitConflict()); + verifyChange(result, "ConflictOutOfBounds", true, 1); + } + + @Test + public void testConflictMarkersFileDeleted() throws Exception { + init("allowconflict_file_deleted", false, false); + + Result result = applyPatchAllowConflicts(); + + assertEquals(1, result.getErrors().size()); + assertEquals(0, result.getPaths().size()); + } + + @Test public void testShiftUp() throws Exception { init("ShiftUp");
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/PatchCcErrorTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/PatchCcErrorTest.java index 71bda46..8335c07 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/PatchCcErrorTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/PatchCcErrorTest.java
@@ -10,7 +10,6 @@ package org.eclipse.jgit.patch; -import static java.lang.Integer.valueOf; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; @@ -35,7 +34,7 @@ public void testError_CcTruncatedOld() throws IOException { assertSame(FormatError.Severity.ERROR, e.getSeverity()); assertEquals(MessageFormat.format( JGitText.get().truncatedHunkLinesMissingForAncestor, - valueOf(1), valueOf(1)), e.getMessage()); + Integer.valueOf(1), Integer.valueOf(1)), e.getMessage()); assertEquals(346, e.getOffset()); assertTrue(e.getLineText().startsWith( "@@@ -55,12 -163,13 +163,15 @@@ public ")); @@ -45,7 +44,7 @@ public void testError_CcTruncatedOld() throws IOException { assertSame(FormatError.Severity.ERROR, e.getSeverity()); assertEquals(MessageFormat.format( JGitText.get().truncatedHunkLinesMissingForAncestor, - valueOf(2), valueOf(2)), e.getMessage()); + Integer.valueOf(2), Integer.valueOf(2)), e.getMessage()); assertEquals(346, e.getOffset()); assertTrue(e.getLineText().startsWith( "@@@ -55,12 -163,13 +163,15 @@@ public "));
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revplot/AbstractPlotRendererTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revplot/AbstractPlotRendererTest.java index 49f832a..e4bd850 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revplot/AbstractPlotRendererTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revplot/AbstractPlotRendererTest.java
@@ -11,7 +11,7 @@ import static org.junit.Assert.assertEquals; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import org.eclipse.jgit.api.Git; @@ -70,7 +70,7 @@ private MergeResult merge(ObjectId includeId) throws GitAPIException { private static class TestPlotRenderer extends AbstractPlotRenderer<PlotLane, Object> { - List<Integer> indentations = new LinkedList<>(); + List<Integer> indentations = new ArrayList<>(); @Override protected int drawLabel(int x, int y, Ref ref) {
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitParseTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitParseTest.java index 82af34d..6872289 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitParseTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitParseTest.java
@@ -153,9 +153,9 @@ public void testParse_incompleteAuthorAndCommitter() throws Exception { c.parseCanonical(rw, b.toString().getBytes(UTF_8)); } assertEquals( - new PersonIdent("", "a_u_thor@example.com", 1218123387000l, 7), + new PersonIdent("", "a_u_thor@example.com", 1218123387000L, 7), c.getAuthorIdent()); - assertEquals(new PersonIdent("", "", 1218123390000l, -5), + assertEquals(new PersonIdent("", "", 1218123390000L, -5), c.getCommitterIdent()); }
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkCommitGraphTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkCommitGraphTest.java index 8215a79..c2f8f10 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkCommitGraphTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkCommitGraphTest.java
@@ -38,6 +38,7 @@ import org.eclipse.jgit.storage.file.FileBasedConfig; import org.eclipse.jgit.treewalk.filter.AndTreeFilter; import org.eclipse.jgit.treewalk.filter.PathFilter; +import org.eclipse.jgit.treewalk.filter.PathFilterGroup; import org.eclipse.jgit.treewalk.filter.TreeFilter; import org.junit.Test; @@ -197,6 +198,35 @@ public void testChangedPathFilter() throws Exception { } @Test + public void testChangedPathFilterWithMultiPaths() throws Exception { + RevCommit c1 = commitFile("file1", "1", "master"); + RevCommit c2 = commitFile("file1", "2", "master"); + RevCommit c3 = commitFile("file2", "3", "master"); + RevCommit c4 = commitFile("file3", "4", "master"); + + enableAndWriteCommitGraph(); + + TreeRevFilter trf = new TreeRevFilter(rw, + PathFilterGroup.createFromStrings(List.of("file1", "file2"))); + rw.markStart(rw.lookupCommit(c4)); + rw.setRevFilter(trf); + assertEquals(c3, rw.next()); + assertEquals(c2, rw.next()); + assertEquals(c1, rw.next()); + assertNull(rw.next()); + + // c2 and c3 has either file1 or file2, c1 did not use ChangedPathFilter + // since it has no parent + assertEquals(2, trf.getChangedPathFilterTruePositive()); + + // No false positives + assertEquals(0, trf.getChangedPathFilterFalsePositive()); + + // c4 does not match either file1 or file2 + assertEquals(1, trf.getChangedPathFilterNegative()); + } + + @Test public void testChangedPathFilterWithFollowFilter() throws Exception { RevCommit c0 = commit(tree()); RevCommit c1 = commit(tree(file("file", blob("contents"))), c0);
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkUtilsReachableTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkUtilsReachableTest.java index 0a045c9..ffc7c96 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkUtilsReachableTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkUtilsReachableTest.java
@@ -14,6 +14,7 @@ import static org.junit.Assert.assertEquals; import java.util.Collection; +import java.util.HashSet; import java.util.List; import org.eclipse.jgit.api.Git; @@ -121,7 +122,7 @@ private void assertContains(RevCommit commit, Collection<Ref> refsThatShouldCont Collection<Ref> sortedRefs = RefComparator.sort(allRefs); List<Ref> actual = RevWalkUtils.findBranchesReachableFrom(commit, rw, sortedRefs); - assertEquals(refsThatShouldContainCommit, actual); + assertEquals(new HashSet<>(refsThatShouldContainCommit), new HashSet<>(actual)); } }
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/TreeRevFilterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/TreeRevFilterTest.java index 298facf..ddbb19c 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/TreeRevFilterTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/TreeRevFilterTest.java
@@ -20,17 +20,33 @@ import org.junit.Test; public class TreeRevFilterTest extends RevWalkTestCase { - private RevFilter treeRevFilter() { - return new TreeRevFilter(rw, TreeFilter.ANY_DIFF); - } - @Test - public void testStringOfPearls_FilePath1() + public void testStringOfPearls_FilePath1_treeRevFilter() throws Exception { RevCommit a = commit(tree(file("d/f", blob("a")))); RevCommit b = commit(tree(file("d/f", blob("a"))), a); RevCommit c = commit(tree(file("d/f", blob("b"))), b); - rw.setRevFilter(treeRevFilter()); + + rw.setRevFilter(new TreeRevFilter(rw, TreeFilter.ANY_DIFF)); + markStart(c); + + assertCommit(c, rw.next()); + assertEquals(1, c.getParentCount()); + assertCommit(b, c.getParent(0)); + + assertCommit(a, rw.next()); // b was skipped + assertEquals(0, a.getParentCount()); + assertNull(rw.next()); + } + @Test + public void testStringOfPearls_FilePath1_noRewriteParents() + throws Exception { + RevCommit a = commit(tree(file("d/f", blob("a")))); + RevCommit b = commit(tree(file("d/f", blob("a"))), a); + RevCommit c = commit(tree(file("d/f", blob("b"))), b); + + rw.setRewriteParents(false); + rw.setTreeFilter(TreeFilter.ANY_DIFF); markStart(c); assertCommit(c, rw.next()); @@ -43,12 +59,74 @@ public void testStringOfPearls_FilePath1() } @Test + public void testStringOfPearls_FilePath1_RewriteParents() + throws Exception { + RevCommit a = commit(tree(file("d/f", blob("a")))); + RevCommit b = commit(tree(file("d/f", blob("a"))), a); + RevCommit c = commit(tree(file("d/f", blob("b"))), b); + + rw.setRevFilter(new TreeRevFilter(rw, TreeFilter.ANY_DIFF)); + rw.setTreeFilter(TreeFilter.ANY_DIFF); + markStart(c); + + assertCommit(c, rw.next()); + assertEquals(1, c.getParentCount()); + assertCommit(a, c.getParent(0)); + + assertCommit(a, rw.next()); // b was skipped + assertEquals(0, a.getParentCount()); + assertNull(rw.next()); + } + + @Test public void testStringOfPearls_FilePath2() throws Exception { RevCommit a = commit(tree(file("d/f", blob("a")))); RevCommit b = commit(tree(file("d/f", blob("a"))), a); RevCommit c = commit(tree(file("d/f", blob("b"))), b); RevCommit d = commit(tree(file("d/f", blob("b"))), c); - rw.setRevFilter(treeRevFilter()); + rw.setRevFilter(new TreeRevFilter(rw, TreeFilter.ANY_DIFF)); + markStart(d); + + // d was skipped + assertCommit(c, rw.next()); + assertEquals(1, c.getParentCount()); + assertCommit(b, c.getParent(0)); + + // b was skipped + assertCommit(a, rw.next()); + assertEquals(0, a.getParentCount()); + assertNull(rw.next()); + } + + @Test + public void testStringOfPearls_FilePath2_RewriteParents() throws Exception { + RevCommit a = commit(tree(file("d/f", blob("a")))); + RevCommit b = commit(tree(file("d/f", blob("a"))), a); + RevCommit c = commit(tree(file("d/f", blob("b"))), b); + RevCommit d = commit(tree(file("d/f", blob("b"))), c); + rw.setTreeFilter(TreeFilter.ANY_DIFF); + markStart(d); + + // d was skipped + assertCommit(c, rw.next()); + assertEquals(1, c.getParentCount()); + assertCommit(a, c.getParent(0)); + + // b was skipped + assertCommit(a, rw.next()); + assertEquals(0, a.getParentCount()); + assertNull(rw.next()); + } + + @Test + public void testStringOfPearls_FilePath2_RewriteParents_False() throws Exception { + RevCommit a = commit(tree(file("d/f", blob("a")))); + RevCommit b = commit(tree(file("d/f", blob("a"))), a); + RevCommit c = commit(tree(file("d/f", blob("b"))), b); + RevCommit d = commit(tree(file("d/f", blob("b"))), c); + rw.setRewriteParents(false); + rw.setRevFilter(new TreeRevFilter(rw, TreeFilter.ANY_DIFF)); + rw.setTreeFilter(TreeFilter.ANY_DIFF); markStart(d); // d was skipped @@ -68,7 +146,7 @@ public void testStringOfPearls_DirPath2() throws Exception { RevCommit b = commit(tree(file("d/f", blob("a"))), a); RevCommit c = commit(tree(file("d/f", blob("b"))), b); RevCommit d = commit(tree(file("d/f", blob("b"))), c); - rw.setRevFilter(treeRevFilter()); + rw.setRevFilter(new TreeRevFilter(rw, TreeFilter.ANY_DIFF)); markStart(d); // d was skipped @@ -93,7 +171,9 @@ public void testStringOfPearls_FilePath3() throws Exception { RevCommit g = commit(tree(file("d/f", blob("b"))), f); RevCommit h = commit(tree(file("d/f", blob("b"))), g); RevCommit i = commit(tree(file("d/f", blob("c"))), h); - rw.setRevFilter(treeRevFilter()); + + // Doesn't rewrite parents since no TreeFilter is set + rw.setRevFilter(new TreeRevFilter(rw, TreeFilter.ANY_DIFF)); markStart(i); assertCommit(i, rw.next()); @@ -112,8 +192,39 @@ public void testStringOfPearls_FilePath3() throws Exception { } @Test + public void testStringOfPearls_FilePath3_RewriteParents() throws Exception { + RevCommit a = commit(tree(file("d/f", blob("a")))); + RevCommit b = commit(tree(file("d/f", blob("a"))), a); + RevCommit c = commit(tree(file("d/f", blob("b"))), b); + RevCommit d = commit(tree(file("d/f", blob("b"))), c); + RevCommit e = commit(tree(file("d/f", blob("b"))), d); + RevCommit f = commit(tree(file("d/f", blob("b"))), e); + RevCommit g = commit(tree(file("d/f", blob("b"))), f); + RevCommit h = commit(tree(file("d/f", blob("b"))), g); + RevCommit i = commit(tree(file("d/f", blob("c"))), h); + + rw.setRevFilter(new TreeRevFilter(rw, TreeFilter.ANY_DIFF)); + rw.setTreeFilter(TreeFilter.ANY_DIFF); + markStart(i); + + assertCommit(i, rw.next()); + assertEquals(1, i.getParentCount()); + assertCommit(c, i.getParent(0)); + + // h..d was skipped + assertCommit(c, rw.next()); + assertEquals(1, c.getParentCount()); + assertCommit(a, c.getParent(0)); + + // b was skipped + assertCommit(a, rw.next()); + assertEquals(0, a.getParentCount()); + assertNull(rw.next()); + } + + @Test public void testPathFilterOrOtherFilter() throws Exception { - RevFilter pathFilter = treeRevFilter(); + RevFilter pathFilter = new TreeRevFilter(rw, TreeFilter.ANY_DIFF); RevFilter skipFilter = SkipRevFilter.create(1); RevFilter orFilter = OrRevFilter.create(skipFilter, pathFilter); @@ -125,6 +236,9 @@ public void testPathFilterOrOtherFilter() throws Exception { rw.setRevFilter(pathFilter); markStart(c); assertCommit(c, rw.next()); + assertEquals(1, c.getParentCount()); + assertCommit(b, c.getParent(0)); + assertCommit(a, rw.next()); // Skip filter matches b, a.
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/AtomicPushTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/AtomicPushTest.java index c47e591..0ba8926 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/AtomicPushTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/AtomicPushTest.java
@@ -25,10 +25,6 @@ import org.eclipse.jgit.junit.TestRepository; import org.eclipse.jgit.lib.NullProgressMonitor; import org.eclipse.jgit.lib.ObjectId; -import org.eclipse.jgit.lib.Repository; -import org.eclipse.jgit.transport.resolver.ReceivePackFactory; -import org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException; -import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -46,16 +42,8 @@ public class AtomicPushTest { public void setUp() throws Exception { server = newRepo("server"); client = newRepo("client"); - testProtocol = new TestProtocol<>( - null, - new ReceivePackFactory<Object>() { - @Override - public ReceivePack create(Object req, Repository db) - throws ServiceNotEnabledException, - ServiceNotAuthorizedException { - return new ReceivePack(db); - } - }); + testProtocol = new TestProtocol<>(null, + (req, db) -> new ReceivePack(db)); uri = testProtocol.register(ctx, server); try (TestRepository<?> clientRepo = new TestRepository<>(client)) {
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PackParserTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PackParserTest.java index 2fd82e7..6148df9 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PackParserTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PackParserTest.java
@@ -191,7 +191,7 @@ public void testTinyThinPack() throws Exception { InMemoryPack pack = new InMemoryPack(); pack.header(1); - pack.write((Constants.OBJ_REF_DELTA) << 4 | 4); + pack.write(Constants.OBJ_REF_DELTA << 4 | 4); pack.copyRaw(a); pack.deflate(new byte[] { 0x1, 0x1, 0x1, 'b' }); pack.digest(); @@ -211,7 +211,7 @@ public void testPackWithDuplicateBlob() throws Exception { InMemoryPack pack = new InMemoryPack(); pack.header(1); - pack.write((Constants.OBJ_BLOB) << 4 | 0x80 | 1); + pack.write(Constants.OBJ_BLOB << 4 | 0x80 | 1); pack.write(1); pack.deflate(data); pack.digest(); @@ -231,9 +231,9 @@ public void testParseOfsDeltaFullSize() throws Exception { InMemoryPack pack = new InMemoryPack(); pack.header(2); - pack.write((Constants.OBJ_BLOB) << 4 | 10); // offset 12 + pack.write(Constants.OBJ_BLOB << 4 | 10); // offset 12 pack.deflate(data); - pack.write((Constants.OBJ_OFS_DELTA) << 4 | 4); // offset 31 + pack.write(Constants.OBJ_OFS_DELTA << 4 | 4); // offset 31 pack.write(19); pack.deflate(new byte[] { 0xA, 0xB, 0x1, 'b' }); pack.digest(); @@ -270,7 +270,7 @@ public void testPackWithTrailingGarbage() throws Exception { InMemoryPack pack = new InMemoryPack(); pack.header(1); - pack.write((Constants.OBJ_REF_DELTA) << 4 | 4); + pack.write(Constants.OBJ_REF_DELTA << 4 | 4); pack.copyRaw(a); pack.deflate(new byte[] { 0x1, 0x1, 0x1, 'b' }); pack.digest(); @@ -300,7 +300,7 @@ public void testMaxObjectSizeFullBlob() throws Exception { InMemoryPack pack = new InMemoryPack(); pack.header(1); - pack.write((Constants.OBJ_BLOB) << 4 | 10); + pack.write(Constants.OBJ_BLOB << 4 | 10); pack.deflate(data); pack.digest(); @@ -333,7 +333,7 @@ public void testMaxObjectSizeDeltaBlock() throws Exception { InMemoryPack pack = new InMemoryPack(); pack.header(1); - pack.write((Constants.OBJ_REF_DELTA) << 4 | 14); + pack.write(Constants.OBJ_REF_DELTA << 4 | 14); pack.copyRaw(a); pack.deflate(new byte[] { 1, 11, 11, 'a', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }); @@ -366,7 +366,7 @@ public void testMaxObjectSizeDeltaResultSize() throws Exception { InMemoryPack pack = new InMemoryPack(); pack.header(1); - pack.write((Constants.OBJ_REF_DELTA) << 4 | 4); + pack.write(Constants.OBJ_REF_DELTA << 4 | 4); pack.copyRaw(a); pack.deflate(new byte[] { 10, 11, 1, 'a' }); pack.digest(); @@ -398,7 +398,7 @@ public void testNonMarkingInputStream() throws Exception { InMemoryPack pack = new InMemoryPack(); pack.header(1); - pack.write((Constants.OBJ_REF_DELTA) << 4 | 4); + pack.write(Constants.OBJ_REF_DELTA << 4 | 4); pack.copyRaw(a); pack.deflate(new byte[] { 0x1, 0x1, 0x1, 'b' }); pack.digest(); @@ -439,7 +439,7 @@ public void testDataAfterPackFooterSingleRead() throws Exception { InMemoryPack pack = new InMemoryPack(); pack.header(1); - pack.write((Constants.OBJ_REF_DELTA) << 4 | 4); + pack.write(Constants.OBJ_REF_DELTA << 4 | 4); pack.copyRaw(a); pack.deflate(new byte[] { 0x1, 0x1, 0x1, 'b' }); pack.digest(); @@ -470,7 +470,7 @@ public void testDataAfterPackFooterSplitObjectRead() throws Exception { pack.header(objects); for (int i = 0; i < objects; i++) { - pack.write((Constants.OBJ_BLOB) << 4 | 10); + pack.write(Constants.OBJ_BLOB << 4 | 10); pack.deflate(data); } pack.digest(); @@ -508,7 +508,7 @@ public void testDataAfterPackFooterSplitHeaderRead() throws Exception { for (int i = 0; i < offset; i++) sb.append(i); offset = sb.toString().length(); - int lenByte = (Constants.OBJ_BLOB) << 4 | (offset & 0x0F); + int lenByte = Constants.OBJ_BLOB << 4 | (offset & 0x0F); offset >>= 4; if (offset > 0) lenByte |= 1 << 7; @@ -525,7 +525,7 @@ public void testDataAfterPackFooterSplitHeaderRead() throws Exception { for (int i = 0; i < objects; i++) { // The last pack header written falls across the 8192 byte boundary // between [8189:8210] - pack.write((Constants.OBJ_REF_DELTA) << 4 | 4); + pack.write(Constants.OBJ_REF_DELTA << 4 | 4); pack.copyRaw(b); pack.deflate(new byte[] { 0x1, 0x1, 0x1, 'b' }); }
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushCertificateIdentTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushCertificateIdentTest.java index f5658ab..cee023d 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushCertificateIdentTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushCertificateIdentTest.java
@@ -73,7 +73,7 @@ public void exoticUserId() throws Exception { @Test public void fuzzyCasesMatchPersonIdent() throws Exception { // See RawParseUtils_ParsePersonIdentTest#testParsePersonIdent_fuzzyCases() - Date when = new Date(1234567890000l); + Date when = new Date(1234567890000L); TimeZone tz = TimeZone.getTimeZone("GMT-7"); assertMatchesPersonIdent( @@ -89,7 +89,7 @@ public void fuzzyCasesMatchPersonIdent() throws Exception { @Test public void incompleteCasesMatchPersonIdent() throws Exception { // See RawParseUtils_ParsePersonIdentTest#testParsePersonIdent_incompleteCases() - Date when = new Date(1234567890000l); + Date when = new Date(1234567890000L); TimeZone tz = TimeZone.getTimeZone("GMT-7"); assertMatchesPersonIdent(
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackAdvertiseRefsHookTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackAdvertiseRefsHookTest.java index a91bc95..7dac27f 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackAdvertiseRefsHookTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackAdvertiseRefsHookTest.java
@@ -187,10 +187,10 @@ public void testSuccess() throws Exception { TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(1024); packHeader(pack, 2); - pack.write((Constants.OBJ_BLOB) << 4 | 1); + pack.write(Constants.OBJ_BLOB << 4 | 1); deflate(pack, new byte[] { 'a' }); - pack.write((Constants.OBJ_REF_DELTA) << 4 | 4); + pack.write(Constants.OBJ_REF_DELTA << 4 | 4); a.copyRawTo(pack); deflate(pack, new byte[] { 0x1, 0x1, 0x1, 'b' }); @@ -296,7 +296,7 @@ public void testUsingHiddenDeltaBaseFails() throws Exception { packHeader(pack, 3); copy(pack, src.open(N)); copy(pack, src.open(s.parseBody(N).getTree())); - pack.write((Constants.OBJ_REF_DELTA) << 4 | 4); + pack.write(Constants.OBJ_REF_DELTA << 4 | 4); b.copyRawTo(pack); deflate(pack, delta); digest(pack);
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/SideBandOutputStreamTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/SideBandOutputStreamTest.java index 3516ed0..444e958 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/SideBandOutputStreamTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/SideBandOutputStreamTest.java
@@ -10,7 +10,6 @@ package org.eclipse.jgit.transport; -import static java.lang.Integer.valueOf; import static java.nio.charset.StandardCharsets.UTF_8; import static org.eclipse.jgit.transport.SideBandOutputStream.CH_DATA; import static org.eclipse.jgit.transport.SideBandOutputStream.CH_ERROR; @@ -224,7 +223,8 @@ public void testConstructor_RejectsBadBufferSize() throws Exception { } catch (IllegalArgumentException e) { assertEquals(MessageFormat.format( JGitText.get().packetSizeMustBeAtMost, - valueOf(Integer.MAX_VALUE), valueOf(65520)), e.getMessage()); + Integer.valueOf(Integer.MAX_VALUE), Integer.valueOf(65520)), + e.getMessage()); } }
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackHandleDeletedPackFileTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackHandleDeletedPackFileTest.java index 417ce61..272c5ea 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackHandleDeletedPackFileTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackHandleDeletedPackFileTest.java
@@ -9,10 +9,9 @@ */ package org.eclipse.jgit.transport; -import static org.junit.Assert.fail; import static org.eclipse.jgit.lib.Constants.HEAD; -import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import java.util.Arrays; import java.util.Collection; @@ -91,7 +90,7 @@ public void testV2BitmapFileRemovedDuringUploadPack() throws Exception { private void doRemovePackFileDuringUploadPack(PackExt packExt) throws Exception { Object ctx = new Object(); - TestProtocol testProtocol = new TestProtocol<>( + TestProtocol<Object> testProtocol = new TestProtocol<>( (Object req, Repository db) -> { UploadPack up = new UploadPack(db); up.setRequestPolicy(RequestPolicy.REACHABLE_COMMIT); @@ -103,11 +102,12 @@ private void doRemovePackFileDuringUploadPack(PackExt packExt) try { addNewCommit(); - new GC(remote.getRepository()).gc(); + new GC(remote.getRepository()).gc().get(); pack.getPackFile().create(packExt).delete(); } catch (Exception e) { - fail("GC or pack file removal failed"); + throw new AssertionError( + "GC or pack file removal failed", e); } return up; @@ -136,7 +136,7 @@ private void setupServerRepo() throws Exception { .create(); remote.update("master", commit0); - new GC(remote.getRepository()).gc(); // create pack files + new GC(remote.getRepository()).gc().get(); // create pack files head = remote.commit().message("1").parent(commit0) .add("test1.txt", remote.blob("1"))
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackReachabilityTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackReachabilityTest.java index 2711762..a5507c8 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackReachabilityTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackReachabilityTest.java
@@ -27,9 +27,6 @@ import org.eclipse.jgit.revwalk.RevBlob; import org.eclipse.jgit.revwalk.RevCommit; import org.eclipse.jgit.transport.UploadPack.RequestPolicy; -import org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException; -import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException; -import org.eclipse.jgit.transport.resolver.UploadPackFactory; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -264,15 +261,10 @@ private void generateBitmaps(InMemoryRepository repo) throws Exception { } private static TestProtocol<Object> generateReachableCommitUploadPackProtocol() { - return new TestProtocol<>(new UploadPackFactory<Object>() { - @Override - public UploadPack create(Object req, Repository db) - throws ServiceNotEnabledException, - ServiceNotAuthorizedException { - UploadPack up = new UploadPack(db); - up.setRequestPolicy(RequestPolicy.REACHABLE_COMMIT); - return up; - } + return new TestProtocol<>((req, db) -> { + UploadPack up = new UploadPack(db); + up.setRequestPolicy(RequestPolicy.REACHABLE_COMMIT); + return up; }, null); } }
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java index 026492f..2bd4003 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java
@@ -11,6 +11,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -501,15 +502,15 @@ public void testV2Capabilities() throws Exception { assertThat(hook.capabilitiesRequest, notNullValue()); assertThat(pckIn.readString(), is("version 2")); assertThat( - Arrays.asList(pckIn.readString(), pckIn.readString(), - pckIn.readString()), + Arrays.asList(pckIn.readString(),pckIn.readString(), + pckIn.readString(), pckIn.readString()), // TODO(jonathantanmy) This check is written this way // to make it simple to see that we expect this list of // capabilities, but probably should be loosened to // allow additional commands to be added to the list, // and additional capabilities to be added to existing // commands without requiring test changes. - hasItems("ls-refs", "fetch=shallow", "server-option")); + hasItems("agent=" + UserAgent.get() ,"ls-refs", "fetch=shallow", "server-option")); assertTrue(PacketLineIn.isEnd(pckIn.readString())); } @@ -535,7 +536,7 @@ private void checkAdvertisedIfAllowed(String configSection, String configName, lines.add(line); } } - assertThat(lines, containsInAnyOrder("ls-refs", "fetch", "server-option")); + assertThat(lines, containsInAnyOrder("ls-refs", "fetch", "server-option", "agent=" + UserAgent.get())); } private void checkUnadvertisedIfUnallowed(String configSection, @@ -564,6 +565,47 @@ private void checkUnadvertisedIfUnallowed(String configSection, } @Test + public void testV0CapabilitiesAllowAnySha1InWant() throws Exception { + checkAvertisedCapabilityProtocolV0IfAllowed("uploadpack", + "allowanysha1inwant", "allow-reachable-sha1-in-want", + "allow-tip-sha1-in-want"); + } + + @Test + public void testV0CapabilitiesAllowReachableSha1InWant() throws Exception { + checkAvertisedCapabilityProtocolV0IfAllowed("uploadpack", + "allowreachablesha1inwant", "allow-reachable-sha1-in-want"); + } + + @Test + public void testV0CapabilitiesAllowTipSha1InWant() throws Exception { + checkAvertisedCapabilityProtocolV0IfAllowed("uploadpack", + "allowtipsha1inwant", "allow-tip-sha1-in-want"); + } + + private void checkAvertisedCapabilityProtocolV0IfAllowed( + String configSection, String configName, String... capabilities) + throws Exception { + server.getConfig().setBoolean(configSection, null, configName, true); + ByteArrayInputStream recvStream = uploadPackSetup( + TransferConfig.ProtocolVersion.V0.version(), null, + PacketLineIn.end()); + PacketLineIn pckIn = new PacketLineIn(recvStream); + + String line; + while (!PacketLineIn.isEnd((line = pckIn.readString()))) { + if (line.contains("capabilities")) { + List<String> linesCapabilities = Arrays.asList(line.substring( + line.indexOf(" ", line.indexOf("capabilities")) + 1) + .split(" ")); + assertThat(linesCapabilities, hasItems(capabilities)); + return; + } + } + fail("Server side protocol did not contain any capabilities'"); + } + + @Test public void testV2CapabilitiesAllowFilter() throws Exception { checkAdvertisedIfAllowed("uploadpack", "allowfilter", "filter"); checkUnadvertisedIfUnallowed("uploadpack", "allowfilter", "filter"); @@ -601,9 +643,9 @@ public void testV2CapabilitiesRefInWantNotAdvertisedIfAdvertisingForbidden() thr assertThat(pckIn.readString(), is("version 2")); assertThat( - Arrays.asList(pckIn.readString(), pckIn.readString(), + Arrays.asList(pckIn.readString(),pckIn.readString(), pckIn.readString(), pckIn.readString()), - hasItems("ls-refs", "fetch=shallow", "server-option")); + hasItems("agent="+ UserAgent.get(),"ls-refs", "fetch=shallow", "server-option")); assertTrue(PacketLineIn.isEnd(pckIn.readString())); } @@ -1800,14 +1842,15 @@ class DeepTreePreparator { RevBlob blobHighDepth = remote.blob("hi"); RevTree subtree = remote.tree(remote.file("1", blobHighDepth)); - RevTree rootTree = (new TreeBuilder() { + + RevTree rootTree = new TreeBuilder() { @Override void addElements(DirCacheBuilder dcBuilder) throws Exception { dcBuilder.add(remote.file("1", blobLowDepth)); dcBuilder.addTree(new byte[] {'2'}, DirCacheEntry.STAGE_0, remote.getRevWalk().getObjectReader(), subtree); } - }).build(); + }.build(); RevCommit commit = remote.commit(rootTree); DeepTreePreparator() throws Exception {} @@ -1904,21 +1947,23 @@ public void testV2FetchFilterTreeDepth2() throws Exception { class RepeatedSubtreePreparator { RevBlob foo = remote.blob("foo"); RevTree subtree3 = remote.tree(remote.file("foo", foo)); - RevTree subtree2 = (new TreeBuilder() { + RevTree subtree2 = new TreeBuilder() { @Override void addElements(DirCacheBuilder dcBuilder) throws Exception { dcBuilder.addTree(new byte[] {'b'}, DirCacheEntry.STAGE_0, remote.getRevWalk().getObjectReader(), subtree3); } - }).build(); - RevTree subtree1 = (new TreeBuilder() { + }.build(); + + RevTree subtree1 = new TreeBuilder() { @Override void addElements(DirCacheBuilder dcBuilder) throws Exception { dcBuilder.addTree(new byte[] {'x'}, DirCacheEntry.STAGE_0, remote.getRevWalk().getObjectReader(), subtree2); } - }).build(); - RevTree rootTree = (new TreeBuilder() { + }.build(); + + RevTree rootTree = new TreeBuilder() { @Override void addElements(DirCacheBuilder dcBuilder) throws Exception { dcBuilder.addTree(new byte[] {'a'}, DirCacheEntry.STAGE_0, @@ -1926,7 +1971,7 @@ void addElements(DirCacheBuilder dcBuilder) throws Exception { dcBuilder.addTree(new byte[] {'x'}, DirCacheEntry.STAGE_0, remote.getRevWalk().getObjectReader(), subtree2); } - }).build(); + }.build(); RevCommit commit = remote.commit(rootTree); RepeatedSubtreePreparator() throws Exception {} @@ -1970,22 +2015,22 @@ class RepeatedSubtreeAtSameLevelPreparator { RevTree subtree1 = remote.tree(remote.file("foo", foo)); /** b/foo */ - RevTree subtree2 = (new TreeBuilder() { + RevTree subtree2 = new TreeBuilder() { @Override void addElements(DirCacheBuilder dcBuilder) throws Exception { dcBuilder.addTree(new byte[] {'b'}, DirCacheEntry.STAGE_0, remote.getRevWalk().getObjectReader(), subtree1); } - }).build(); + }.build(); /** x/b/foo */ - RevTree subtree3 = (new TreeBuilder() { + RevTree subtree3 = new TreeBuilder() { @Override void addElements(DirCacheBuilder dcBuilder) throws Exception { dcBuilder.addTree(new byte[] {'x'}, DirCacheEntry.STAGE_0, remote.getRevWalk().getObjectReader(), subtree2); } - }).build(); + }.build(); RevBlob baz = remote.blob("baz"); @@ -1993,33 +2038,33 @@ void addElements(DirCacheBuilder dcBuilder) throws Exception { RevTree subtree4 = remote.tree(remote.file("baz", baz)); /** c/baz */ - RevTree subtree5 = (new TreeBuilder() { + RevTree subtree5 = new TreeBuilder() { @Override void addElements(DirCacheBuilder dcBuilder) throws Exception { dcBuilder.addTree(new byte[] {'c'}, DirCacheEntry.STAGE_0, remote.getRevWalk().getObjectReader(), subtree4); } - }).build(); + }.build(); /** u/c/baz */ - RevTree subtree6 = (new TreeBuilder() { + RevTree subtree6 = new TreeBuilder() { @Override void addElements(DirCacheBuilder dcBuilder) throws Exception { dcBuilder.addTree(new byte[] {'u'}, DirCacheEntry.STAGE_0, remote.getRevWalk().getObjectReader(), subtree5); } - }).build(); + }.build(); /** v/c/baz */ - RevTree subtree7 = (new TreeBuilder() { + RevTree subtree7 = new TreeBuilder() { @Override void addElements(DirCacheBuilder dcBuilder) throws Exception { dcBuilder.addTree(new byte[] {'v'}, DirCacheEntry.STAGE_0, remote.getRevWalk().getObjectReader(), subtree5); } - }).build(); + }.build(); - RevTree rootTree = (new TreeBuilder() { + RevTree rootTree = new TreeBuilder() { @Override void addElements(DirCacheBuilder dcBuilder) throws Exception { dcBuilder.addTree(new byte[] {'a'}, DirCacheEntry.STAGE_0, @@ -2031,7 +2076,7 @@ void addElements(DirCacheBuilder dcBuilder) throws Exception { dcBuilder.addTree(new byte[] {'z'}, DirCacheEntry.STAGE_0, remote.getRevWalk().getObjectReader(), subtree7); } - }).build(); + }.build(); RevCommit commit = remote.commit(rootTree); RepeatedSubtreeAtSameLevelPreparator() throws Exception {}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/http/JDKHttpConnectionTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/http/JDKHttpConnectionTest.java index 37f9514..f71781d 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/http/JDKHttpConnectionTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/http/JDKHttpConnectionTest.java
@@ -16,9 +16,9 @@ import static org.mockito.Mockito.when; import java.net.HttpURLConnection; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; -import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -74,7 +74,7 @@ public void testCommaSeparatedList() { } private void assertValues(String key, String... values) { - List<String> l = new LinkedList<>(); + List<String> l = new ArrayList<>(); List<String> hf = c.getHeaderFields(key); if (hf != null) { l.addAll(hf);
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java index 32bd403..1bb4939 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java
@@ -11,6 +11,7 @@ package org.eclipse.jgit.treewalk.filter; import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -21,7 +22,9 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.Set; +import java.util.stream.Collectors; import org.eclipse.jgit.dircache.DirCache; import org.eclipse.jgit.dircache.DirCacheEditor; @@ -30,6 +33,7 @@ import org.eclipse.jgit.errors.IncorrectObjectTypeException; import org.eclipse.jgit.errors.MissingObjectException; import org.eclipse.jgit.errors.StopWalkException; +import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.FileMode; import org.eclipse.jgit.lib.ObjectReader; import org.eclipse.jgit.lib.Sets; @@ -143,6 +147,29 @@ public void testLongPaths() throws MissingObjectException, } @Test + public void testGetPathsBestEffort() { + String[] paths = { "path1", "path2", "path3" }; + Set<byte[]> expected = Arrays.stream(paths).map(Constants::encode) + .collect(Collectors.toSet()); + TreeFilter pathFilterGroup = PathFilterGroup.createFromStrings(paths); + Optional<Set<byte[]>> bestEffortPaths = pathFilterGroup + .getPathsBestEffort(); + assertTrue(bestEffortPaths.isPresent()); + Set<byte[]> actual = bestEffortPaths.get(); + assertEquals(expected.size(), actual.size()); + for (byte[] actualPath : actual) { + boolean findMatch = false; + for (byte[] expectedPath : expected) { + if (Arrays.equals(actualPath, expectedPath)) { + findMatch = true; + break; + } + } + assertTrue(findMatch); + } + } + + @Test public void testStopWalk() throws MissingObjectException, IncorrectObjectTypeException, IOException { // Obvious
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/BlockListTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/BlockListTest.java index a270ca8..b8b9cbe 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/BlockListTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/BlockListTest.java
@@ -296,6 +296,7 @@ public void testFastIterator() { public void testAddRejectsBadIndexes() { BlockList<Integer> list = new BlockList<>(4); list.add(Integer.valueOf(41)); + assertEquals(Integer.valueOf(41), list.get(0)); try { list.add(-1, Integer.valueOf(42)); @@ -316,6 +317,7 @@ public void testAddRejectsBadIndexes() { public void testRemoveRejectsBadIndexes() { BlockList<Integer> list = new BlockList<>(4); list.add(Integer.valueOf(41)); + assertEquals(Integer.valueOf(41), list.get(0)); try { list.remove(-1);
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FileUtilsTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FileUtilsTest.java index 2b1fb2e..5106540 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FileUtilsTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FileUtilsTest.java
@@ -74,7 +74,9 @@ public void testDeleteFile() throws IOException { try { FileUtils.delete(f, FileUtils.SKIP_MISSING); } catch (IOException e) { - fail("deletion of non-existing file must not fail with option SKIP_MISSING"); + throw new AssertionError( + "deletion of non-existing file must not fail with option SKIP_MISSING", + e); } } @@ -108,7 +110,9 @@ public void testDeleteRecursive() throws IOException { try { FileUtils.delete(d, FileUtils.RECURSIVE | FileUtils.SKIP_MISSING); } catch (IOException e) { - fail("recursive deletion of non-existing directory must not fail with option SKIP_MISSING"); + throw new AssertionError( + "recursive deletion of non-existing directory must not fail with option SKIP_MISSING", + e); } }
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitDateFormatterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitDateFormatterTest.java index 0bd7e0b..7ef386f 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitDateFormatterTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/GitDateFormatterTest.java
@@ -90,7 +90,8 @@ public void RAW() { public void LOCALE() { String date = new GitDateFormatter(Format.LOCALE).formatDate(ident); assertTrue("Sep 20, 2011 7:09:25 PM -0400".equals(date) - || "Sep 20, 2011, 7:09:25 PM -0400".equals(date)); // JDK-8206961 + || "Sep 20, 2011, 7:09:25 PM -0400".equals(date) // JDK-8206961 + || "Sep 20, 2011, 7:09:25\u202FPM -0400".equals(date)); // JDK-8304925 } @Test @@ -98,6 +99,7 @@ public void LOCALELOCAL() { String date = new GitDateFormatter(Format.LOCALELOCAL) .formatDate(ident); assertTrue("Sep 20, 2011 7:39:25 PM".equals(date) - || "Sep 20, 2011, 7:39:25 PM".equals(date)); // JDK-8206961 + || "Sep 20, 2011, 7:39:25 PM".equals(date) // JDK-8206961 + || "Sep 20, 2011, 7:39:25\u202FPM".equals(date)); // JDK-8304925 } }
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/HookTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/HookTest.java index 1231aef..b7490f0 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/HookTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/HookTest.java
@@ -157,7 +157,7 @@ public void testAllCommitHooks() throws Exception { git.commit().setMessage("commit") .setHookOutputStream(new PrintStream(out)).call(); } catch (AbortedByHookException e) { - fail("unexpected hook failure"); + throw new AssertionError("unexpected hook failure", e); } assertEquals("unexpected hook output", "test pre-commit\ntest commit-msg .git/COMMIT_EDITMSG\ntest post-commit\n",
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/HttpSupportTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/HttpSupportTest.java index cbe4eb2..a3a5697 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/HttpSupportTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/HttpSupportTest.java
@@ -47,18 +47,6 @@ public void connectFailed(URI uri, SocketAddress sa, IOException ioe) { } @Test - public void testMalformedUri() throws Exception { - // Valid URL, but backslash is not allowed in a URI in the userinfo part - // per RFC 3986: https://tools.ietf.org/html/rfc3986#section-3.2.1 . - // Test that conversion to URI to call the ProxySelector does not throw - // an exception. - Proxy proxy = HttpSupport.proxyFor(new TestProxySelector(), new URL( - "http://infor\\c.jones@somehost/somewhere/someproject.git")); - assertNotNull(proxy); - assertEquals(Proxy.Type.HTTP, proxy.type()); - } - - @Test public void testCorrectUri() throws Exception { // Backslash escaped as %5C is correct. Proxy proxy = HttpSupport.proxyFor(new TestProxySelector(), new URL(
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RawParseUtils_ParsePersonIdentTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RawParseUtils_ParsePersonIdentTest.java index ee3ce8d..355bbba 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RawParseUtils_ParsePersonIdentTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RawParseUtils_ParsePersonIdentTest.java
@@ -22,7 +22,7 @@ public class RawParseUtils_ParsePersonIdentTest { @Test public void testParsePersonIdent_legalCases() { - final Date when = new Date(1234567890000l); + final Date when = new Date(1234567890000L); final TimeZone tz = TimeZone.getTimeZone("GMT-7"); assertPersonIdent("Me <me@example.com> 1234567890 -0700", @@ -50,7 +50,7 @@ public void testParsePersonIdent_legalCases() { @Test public void testParsePersonIdent_fuzzyCases() { - final Date when = new Date(1234567890000l); + final Date when = new Date(1234567890000L); final TimeZone tz = TimeZone.getTimeZone("GMT-7"); assertPersonIdent( @@ -64,7 +64,7 @@ public void testParsePersonIdent_fuzzyCases() { @Test public void testParsePersonIdent_incompleteCases() { - final Date when = new Date(1234567890000l); + final Date when = new Date(1234567890000L); final TimeZone tz = TimeZone.getTimeZone("GMT-7"); assertPersonIdent("Me <> 1234567890 -0700", new PersonIdent("Me", "",
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RefMapTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RefMapTest.java index 627417d..a8077fd 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RefMapTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RefMapTest.java
@@ -268,6 +268,7 @@ public void testMerge_WithPrefix() { assertFalse(itr.hasNext()); } + @SuppressWarnings("ModifiedButNotUsed") @Test public void testPut_KeyMustMatchName_NoPrefix() { final Ref refA = newRef("refs/heads/A", ID_ONE); @@ -280,6 +281,7 @@ public void testPut_KeyMustMatchName_NoPrefix() { } } + @SuppressWarnings("ModifiedButNotUsed") @Test public void testPut_KeyMustMatchName_WithPrefix() { final Ref refA = newRef("refs/heads/A", ID_ONE);
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/http/HttpCookiesMatcher.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/http/HttpCookiesMatcher.java index 5a2bd97..c1c7280 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/http/HttpCookiesMatcher.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/http/HttpCookiesMatcher.java
@@ -10,7 +10,7 @@ package org.eclipse.jgit.util.http; import java.net.HttpCookie; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import org.hamcrest.Description; @@ -26,7 +26,7 @@ public static Matcher<Iterable<? extends HttpCookie>> containsInOrder( public static Matcher<Iterable<? extends HttpCookie>> containsInOrder( Iterable<HttpCookie> expectedCookies, int allowedMaxAgeDelta) { - final List<Matcher<? super HttpCookie>> cookieMatchers = new LinkedList<>(); + final List<Matcher<? super HttpCookie>> cookieMatchers = new ArrayList<>(); for (HttpCookie cookie : expectedCookies) { cookieMatchers .add(new HttpCookieMatcher(cookie, allowedMaxAgeDelta)); @@ -92,7 +92,7 @@ private static boolean equals(String value1, String value2) { } @SuppressWarnings("boxing") - protected static void describeCookie(Description description, + private static void describeCookie(Description description, HttpCookie cookie) { description.appendText("HttpCookie["); description.appendText("name: ").appendValue(cookie.getName())
diff --git a/org.eclipse.jgit.ui/META-INF/MANIFEST.MF b/org.eclipse.jgit.ui/META-INF/MANIFEST.MF index 00e7f53..6c2ced4 100644 --- a/org.eclipse.jgit.ui/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.ui/META-INF/MANIFEST.MF
@@ -4,14 +4,14 @@ Bundle-Name: %Bundle-Name Automatic-Module-Name: org.eclipse.jgit.ui Bundle-SymbolicName: org.eclipse.jgit.ui -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-Vendor: %Bundle-Vendor Bundle-RequiredExecutionEnvironment: JavaSE-11 -Export-Package: org.eclipse.jgit.awtui;version="6.9.1" -Import-Package: org.eclipse.jgit.errors;version="[6.9.1,6.10.0)", - org.eclipse.jgit.lib;version="[6.9.1,6.10.0)", - org.eclipse.jgit.nls;version="[6.9.1,6.10.0)", - org.eclipse.jgit.revplot;version="[6.9.1,6.10.0)", - org.eclipse.jgit.revwalk;version="[6.9.1,6.10.0)", - org.eclipse.jgit.transport;version="[6.9.1,6.10.0)", - org.eclipse.jgit.util;version="[6.9.1,6.10.0)" +Export-Package: org.eclipse.jgit.awtui;version="6.10.2" +Import-Package: org.eclipse.jgit.errors;version="[6.10.2,6.11.0)", + org.eclipse.jgit.lib;version="[6.10.2,6.11.0)", + org.eclipse.jgit.nls;version="[6.10.2,6.11.0)", + org.eclipse.jgit.revplot;version="[6.10.2,6.11.0)", + org.eclipse.jgit.revwalk;version="[6.10.2,6.11.0)", + org.eclipse.jgit.transport;version="[6.10.2,6.11.0)", + org.eclipse.jgit.util;version="[6.10.2,6.11.0)"
diff --git a/org.eclipse.jgit.ui/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.ui/META-INF/SOURCE-MANIFEST.MF index 8462fb0..b690752 100644 --- a/org.eclipse.jgit.ui/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.ui/META-INF/SOURCE-MANIFEST.MF
@@ -3,5 +3,5 @@ Bundle-Name: org.eclipse.jgit.ui - Sources Bundle-SymbolicName: org.eclipse.jgit.ui.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 6.9.1.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.ui;version="6.9.1.qualifier";roots="." +Bundle-Version: 6.10.2.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.ui;version="6.10.2.qualifier";roots="."
diff --git a/org.eclipse.jgit.ui/pom.xml b/org.eclipse.jgit.ui/pom.xml index 9f7cfad..92f86c3 100644 --- a/org.eclipse.jgit.ui/pom.xml +++ b/org.eclipse.jgit.ui/pom.xml
@@ -19,7 +19,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.ui</artifactId>
diff --git a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java index 47acc11..9014526 100644 --- a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java +++ b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java
@@ -11,16 +11,17 @@ package org.eclipse.jgit.awtui; import java.awt.Color; -import java.util.LinkedList; +import java.util.ArrayDeque; +import java.util.Deque; import org.eclipse.jgit.revplot.PlotCommitList; import org.eclipse.jgit.revplot.PlotLane; class SwingCommitList extends PlotCommitList<SwingCommitList.SwingLane> { - final LinkedList<Color> colors; + final Deque<Color> colors; SwingCommitList() { - colors = new LinkedList<>(); + colors = new ArrayDeque<>(); repackColors(); }
diff --git a/org.eclipse.jgit/.settings/.api_filters b/org.eclipse.jgit/.settings/.api_filters index dda62f2..4d7d7d0 100644 --- a/org.eclipse.jgit/.settings/.api_filters +++ b/org.eclipse.jgit/.settings/.api_filters
@@ -1,18 +1,98 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <component id="org.eclipse.jgit" version="2"> - <resource path="src/org/eclipse/jgit/lib/GpgSignatureVerifier.java" type="org.eclipse.jgit.lib.GpgSignatureVerifier"> - <filter id="404000815"> + <resource path="src/org/eclipse/jgit/diff/DiffDriver.java" type="org.eclipse.jgit.diff.DiffDriver"> + <filter id="1109393411"> <message_arguments> - <message_argument value="org.eclipse.jgit.lib.GpgSignatureVerifier"/> - <message_argument value="verify(GpgConfig, byte[], byte[])"/> + <message_argument value="6.10.1"/> + <message_argument value="org.eclipse.jgit.diff.DiffDriver"/> </message_arguments> </filter> </resource> - <resource path="src/org/eclipse/jgit/storage/pack/PackConfig.java" type="org.eclipse.jgit.storage.pack.PackConfig"> + <resource path="src/org/eclipse/jgit/diff/DiffFormatter.java" type="org.eclipse.jgit.diff.DiffFormatter"> + <filter id="1142947843"> + <message_arguments> + <message_argument value="6.10.1"/> + <message_argument value="format(EditList, RawText, RawText, DiffDriver)"/> + </message_arguments> + </filter> + <filter id="1142947843"> + <message_arguments> + <message_argument value="6.10.1"/> + <message_argument value="format(FileHeader, RawText, RawText, DiffDriver)"/> + </message_arguments> + </filter> + <filter id="1142947843"> + <message_arguments> + <message_argument value="6.10.1"/> + <message_argument value="writeHunkHeader(int, int, int, int, String)"/> + </message_arguments> + </filter> + </resource> + <resource path="src/org/eclipse/jgit/gitrepo/RepoProject.java" type="org.eclipse.jgit.gitrepo.RepoProject"> + <filter id="1141899266"> + <message_arguments> + <message_argument value="7.0"/> + <message_argument value="6.10"/> + <message_argument value="getDestBranch()"/> + </message_arguments> + </filter> + <filter id="1141899266"> + <message_arguments> + <message_argument value="7.0"/> + <message_argument value="6.10"/> + <message_argument value="setDestBranch(String)"/> + </message_arguments> + </filter> + </resource> + <resource path="src/org/eclipse/jgit/lib/Constants.java" type="org.eclipse.jgit.lib.Constants"> + <filter id="1142947843"> + <message_arguments> + <message_argument value="6.10.1"/> + <message_argument value="ATTR_BUILTIN_UNION_MERGE_DRIVER"/> + </message_arguments> + </filter> + </resource> + <resource path="src/org/eclipse/jgit/merge/ContentMergeStrategy.java" type="org.eclipse.jgit.merge.ContentMergeStrategy"> + <filter id="1176502275"> + <message_arguments> + <message_argument value="6.10.1"/> + <message_argument value="UNION"/> + </message_arguments> + </filter> + </resource> + <resource path="src/org/eclipse/jgit/merge/ResolveMerger.java" type="org.eclipse.jgit.merge.ResolveMerger"> <filter id="336658481"> <message_arguments> - <message_argument value="org.eclipse.jgit.storage.pack.PackConfig"/> - <message_argument value="DEFAULT_BITMAP_EXCESSIVE_BRANCH_TIP_COUNT"/> + <message_argument value="org.eclipse.jgit.merge.ResolveMerger"/> + <message_argument value="attributesNodeProvider"/> + </message_arguments> + </filter> + <filter id="1142947843"> + <message_arguments> + <message_argument value="6.10.1"/> + <message_argument value="attributesNodeProvider"/> + </message_arguments> + </filter> + <filter id="1142947843"> + <message_arguments> + <message_argument value="6.10.1"/> + <message_argument value="setAttributesNodeProvider(AttributesNodeProvider)"/> + </message_arguments> + </filter> + </resource> + <resource path="src/org/eclipse/jgit/revwalk/RevWalk.java" type="org.eclipse.jgit.revwalk.RevWalk"> + <filter id="1142947843"> + <message_arguments> + <message_argument value="6.10.1"/> + <message_argument value="isMergedIntoAnyCommit(RevCommit, Collection<RevCommit>)"/> + </message_arguments> + </filter> + </resource> + <resource path="src/org/eclipse/jgit/transport/UploadPack.java" type="org.eclipse.jgit.transport.UploadPack$RequestPolicy"> + <filter id="1176502275"> + <message_arguments> + <message_argument value="6.10.1"/> + <message_argument value="implies(UploadPack.RequestPolicy)"/> </message_arguments> </filter> </resource>
diff --git a/org.eclipse.jgit/META-INF/MANIFEST.MF b/org.eclipse.jgit/META-INF/MANIFEST.MF index b2b01fd..30533bd 100644 --- a/org.eclipse.jgit/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit/META-INF/MANIFEST.MF
@@ -3,12 +3,14 @@ Bundle-Name: %Bundle-Name Automatic-Module-Name: org.eclipse.jgit Bundle-SymbolicName: org.eclipse.jgit -Bundle-Version: 6.9.1.qualifier +Bundle-Version: 6.10.2.qualifier Bundle-Localization: OSGI-INF/l10n/plugin Bundle-Vendor: %Bundle-Vendor +Bundle-ActivationPolicy: lazy +Service-Component: OSGI-INF/org.eclipse.jgit.internal.util.CleanupService.xml Eclipse-ExtensibleAPI: true -Export-Package: org.eclipse.jgit.annotations;version="6.9.1", - org.eclipse.jgit.api;version="6.9.1"; +Export-Package: org.eclipse.jgit.annotations;version="6.10.2", + org.eclipse.jgit.api;version="6.10.2"; uses:="org.eclipse.jgit.transport, org.eclipse.jgit.notes, org.eclipse.jgit.dircache, @@ -23,18 +25,18 @@ org.eclipse.jgit.revwalk.filter, org.eclipse.jgit.blame, org.eclipse.jgit.merge", - org.eclipse.jgit.api.errors;version="6.9.1"; + org.eclipse.jgit.api.errors;version="6.10.2"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.errors", - org.eclipse.jgit.attributes;version="6.9.1"; + org.eclipse.jgit.attributes;version="6.10.2"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.treewalk", - org.eclipse.jgit.blame;version="6.9.1"; + org.eclipse.jgit.blame;version="6.10.2"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.revwalk, org.eclipse.jgit.treewalk.filter, org.eclipse.jgit.diff", - org.eclipse.jgit.diff;version="6.9.1"; + org.eclipse.jgit.diff;version="6.10.2"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.attributes, org.eclipse.jgit.revwalk, @@ -42,53 +44,53 @@ org.eclipse.jgit.treewalk.filter, org.eclipse.jgit.treewalk, org.eclipse.jgit.util", - org.eclipse.jgit.dircache;version="6.9.1"; + org.eclipse.jgit.dircache;version="6.10.2"; uses:="org.eclipse.jgit.events, org.eclipse.jgit.lib, org.eclipse.jgit.attributes, org.eclipse.jgit.treewalk, org.eclipse.jgit.util", - org.eclipse.jgit.errors;version="6.9.1"; + org.eclipse.jgit.errors;version="6.10.2"; uses:="org.eclipse.jgit.transport, org.eclipse.jgit.dircache, org.eclipse.jgit.lib, org.eclipse.jgit.internal.storage.pack", - org.eclipse.jgit.events;version="6.9.1"; + org.eclipse.jgit.events;version="6.10.2"; uses:="org.eclipse.jgit.lib", - org.eclipse.jgit.fnmatch;version="6.9.1", - org.eclipse.jgit.gitrepo;version="6.9.1"; + org.eclipse.jgit.fnmatch;version="6.10.2", + org.eclipse.jgit.gitrepo;version="6.10.2"; uses:="org.xml.sax.helpers, org.eclipse.jgit.api, org.eclipse.jgit.lib, org.eclipse.jgit.revwalk, org.xml.sax", - org.eclipse.jgit.gitrepo.internal;version="6.9.1";x-internal:=true, - org.eclipse.jgit.hooks;version="6.9.1";uses:="org.eclipse.jgit.lib", - org.eclipse.jgit.ignore;version="6.9.1", - org.eclipse.jgit.ignore.internal;version="6.9.1"; + org.eclipse.jgit.gitrepo.internal;version="6.10.2";x-internal:=true, + org.eclipse.jgit.hooks;version="6.10.2";uses:="org.eclipse.jgit.lib", + org.eclipse.jgit.ignore;version="6.10.2", + org.eclipse.jgit.ignore.internal;version="6.10.2"; x-friends:="org.eclipse.jgit.test", - org.eclipse.jgit.internal;version="6.9.1"; + org.eclipse.jgit.internal;version="6.10.2"; x-friends:="org.eclipse.jgit.test, org.eclipse.jgit.http.test", - org.eclipse.jgit.internal.diff;version="6.9.1"; + org.eclipse.jgit.internal.diff;version="6.10.2"; x-friends:="org.eclipse.jgit.test", - org.eclipse.jgit.internal.diffmergetool;version="6.9.1"; + org.eclipse.jgit.internal.diffmergetool;version="6.10.2"; x-friends:="org.eclipse.jgit.test, org.eclipse.jgit.pgm.test, org.eclipse.jgit.pgm, org.eclipse.egit.ui", - org.eclipse.jgit.internal.fsck;version="6.9.1"; + org.eclipse.jgit.internal.fsck;version="6.10.2"; x-friends:="org.eclipse.jgit.test", - org.eclipse.jgit.internal.revwalk;version="6.9.1"; + org.eclipse.jgit.internal.revwalk;version="6.10.2"; x-friends:="org.eclipse.jgit.test", - org.eclipse.jgit.internal.storage.commitgraph;version="6.9.1"; + org.eclipse.jgit.internal.storage.commitgraph;version="6.10.2"; x-friends:="org.eclipse.jgit.test", - org.eclipse.jgit.internal.storage.dfs;version="6.9.1"; + org.eclipse.jgit.internal.storage.dfs;version="6.10.2"; x-friends:="org.eclipse.jgit.test, org.eclipse.jgit.http.server, org.eclipse.jgit.http.test, org.eclipse.jgit.lfs.test", - org.eclipse.jgit.internal.storage.file;version="6.9.1"; + org.eclipse.jgit.internal.storage.file;version="6.10.2"; x-friends:="org.eclipse.jgit.test, org.eclipse.jgit.junit, org.eclipse.jgit.junit.http, @@ -97,36 +99,36 @@ org.eclipse.jgit.pgm, org.eclipse.jgit.pgm.test, org.eclipse.jgit.ssh.apache", - org.eclipse.jgit.internal.storage.io;version="6.9.1"; + org.eclipse.jgit.internal.storage.io;version="6.10.2"; x-friends:="org.eclipse.jgit.junit, org.eclipse.jgit.test, org.eclipse.jgit.pgm", - org.eclipse.jgit.internal.storage.memory;version="6.9.1"; + org.eclipse.jgit.internal.storage.memory;version="6.10.2"; x-friends:="org.eclipse.jgit.test", - org.eclipse.jgit.internal.storage.pack;version="6.9.1"; + org.eclipse.jgit.internal.storage.pack;version="6.10.2"; x-friends:="org.eclipse.jgit.junit, org.eclipse.jgit.test, org.eclipse.jgit.pgm", - org.eclipse.jgit.internal.storage.reftable;version="6.9.1"; + org.eclipse.jgit.internal.storage.reftable;version="6.10.2"; x-friends:="org.eclipse.jgit.http.test, org.eclipse.jgit.junit, org.eclipse.jgit.test, org.eclipse.jgit.pgm", - org.eclipse.jgit.internal.submodule;version="6.9.1";x-internal:=true, - org.eclipse.jgit.internal.transport.connectivity;version="6.9.1"; + org.eclipse.jgit.internal.submodule;version="6.10.2";x-internal:=true, + org.eclipse.jgit.internal.transport.connectivity;version="6.10.2"; x-friends:="org.eclipse.jgit.test", - org.eclipse.jgit.internal.transport.http;version="6.9.1"; + org.eclipse.jgit.internal.transport.http;version="6.10.2"; x-friends:="org.eclipse.jgit.test", - org.eclipse.jgit.internal.transport.parser;version="6.9.1"; + org.eclipse.jgit.internal.transport.parser;version="6.10.2"; x-friends:="org.eclipse.jgit.http.server, org.eclipse.jgit.test", - org.eclipse.jgit.internal.transport.ssh;version="6.9.1"; + org.eclipse.jgit.internal.transport.ssh;version="6.10.2"; x-friends:="org.eclipse.jgit.ssh.apache, org.eclipse.jgit.ssh.jsch, org.eclipse.jgit.test", - org.eclipse.jgit.internal.util;version="6.9.1"; + org.eclipse.jgit.internal.util;version="6.10.2"; x-friends:=" org.eclipse.jgit.junit", - org.eclipse.jgit.lib;version="6.9.1"; + org.eclipse.jgit.lib;version="6.10.2"; uses:="org.eclipse.jgit.transport, org.eclipse.jgit.util.sha1, org.eclipse.jgit.dircache, @@ -140,12 +142,12 @@ org.eclipse.jgit.util, org.eclipse.jgit.submodule, org.eclipse.jgit.util.time", - org.eclipse.jgit.lib.internal;version="6.9.1"; + org.eclipse.jgit.lib.internal;version="6.10.2"; x-friends:="org.eclipse.jgit.test, org.eclipse.jgit.pgm, org.eclipse.egit.ui", - org.eclipse.jgit.logging;version="6.9.1", - org.eclipse.jgit.merge;version="6.9.1"; + org.eclipse.jgit.logging;version="6.10.2", + org.eclipse.jgit.merge;version="6.10.2"; uses:="org.eclipse.jgit.dircache, org.eclipse.jgit.lib, org.eclipse.jgit.revwalk, @@ -154,40 +156,40 @@ org.eclipse.jgit.util, org.eclipse.jgit.api, org.eclipse.jgit.attributes", - org.eclipse.jgit.nls;version="6.9.1", - org.eclipse.jgit.notes;version="6.9.1"; + org.eclipse.jgit.nls;version="6.10.2", + org.eclipse.jgit.notes;version="6.10.2"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.revwalk, org.eclipse.jgit.treewalk, org.eclipse.jgit.merge", - org.eclipse.jgit.patch;version="6.9.1"; + org.eclipse.jgit.patch;version="6.10.2"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.diff", - org.eclipse.jgit.revplot;version="6.9.1"; + org.eclipse.jgit.revplot;version="6.10.2"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.revwalk", - org.eclipse.jgit.revwalk;version="6.9.1"; + org.eclipse.jgit.revwalk;version="6.10.2"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.diff, org.eclipse.jgit.treewalk.filter, org.eclipse.jgit.revwalk.filter, org.eclipse.jgit.treewalk", - org.eclipse.jgit.revwalk.filter;version="6.9.1"; + org.eclipse.jgit.revwalk.filter;version="6.10.2"; uses:="org.eclipse.jgit.revwalk, org.eclipse.jgit.lib, org.eclipse.jgit.util", - org.eclipse.jgit.storage.file;version="6.9.1"; + org.eclipse.jgit.storage.file;version="6.10.2"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.util", - org.eclipse.jgit.storage.pack;version="6.9.1"; + org.eclipse.jgit.storage.pack;version="6.10.2"; uses:="org.eclipse.jgit.lib", - org.eclipse.jgit.submodule;version="6.9.1"; + org.eclipse.jgit.submodule;version="6.10.2"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.diff, org.eclipse.jgit.treewalk.filter, org.eclipse.jgit.treewalk, org.eclipse.jgit.util", - org.eclipse.jgit.transport;version="6.9.1"; + org.eclipse.jgit.transport;version="6.10.2"; uses:="javax.crypto, org.eclipse.jgit.util.io, org.eclipse.jgit.lib, @@ -200,21 +202,21 @@ org.eclipse.jgit.transport.resolver, org.eclipse.jgit.storage.pack, org.eclipse.jgit.errors", - org.eclipse.jgit.transport.http;version="6.9.1"; + org.eclipse.jgit.transport.http;version="6.10.2"; uses:="javax.net.ssl", - org.eclipse.jgit.transport.resolver;version="6.9.1"; + org.eclipse.jgit.transport.resolver;version="6.10.2"; uses:="org.eclipse.jgit.transport, org.eclipse.jgit.lib", - org.eclipse.jgit.treewalk;version="6.9.1"; + org.eclipse.jgit.treewalk;version="6.10.2"; uses:="org.eclipse.jgit.dircache, org.eclipse.jgit.lib, org.eclipse.jgit.attributes, org.eclipse.jgit.revwalk, org.eclipse.jgit.treewalk.filter, org.eclipse.jgit.util", - org.eclipse.jgit.treewalk.filter;version="6.9.1"; + org.eclipse.jgit.treewalk.filter;version="6.10.2"; uses:="org.eclipse.jgit.treewalk", - org.eclipse.jgit.util;version="6.9.1"; + org.eclipse.jgit.util;version="6.10.2"; uses:="org.eclipse.jgit.transport, org.eclipse.jgit.hooks, org.eclipse.jgit.revwalk, @@ -227,18 +229,18 @@ org.eclipse.jgit.treewalk, javax.net.ssl, org.eclipse.jgit.util.time", - org.eclipse.jgit.util.io;version="6.9.1"; + org.eclipse.jgit.util.io;version="6.10.2"; uses:="org.eclipse.jgit.attributes, org.eclipse.jgit.lib, org.eclipse.jgit.treewalk", - org.eclipse.jgit.util.sha1;version="6.9.1", - org.eclipse.jgit.util.time;version="6.9.1" + org.eclipse.jgit.util.sha1;version="6.10.2", + org.eclipse.jgit.util.time;version="6.10.2" Bundle-RequiredExecutionEnvironment: JavaSE-11 Import-Package: com.googlecode.javaewah;version="[1.1.6,2.0.0)", javax.crypto, javax.management, javax.net.ssl, - org.apache.commons.codec.digest;version="1.15.0", + org.apache.commons.codec.digest;version="[1.15.0,2.0.0)", org.slf4j;version="[1.7.0,3.0.0)", org.xml.sax, org.xml.sax.helpers
diff --git a/org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF index 70e1e49..4d5f3e9 100644 --- a/org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF
@@ -3,5 +3,5 @@ Bundle-Name: org.eclipse.jgit - Sources Bundle-SymbolicName: org.eclipse.jgit.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 6.9.1.qualifier -Eclipse-SourceBundle: org.eclipse.jgit;version="6.9.1.qualifier";roots="." +Bundle-Version: 6.10.2.qualifier +Eclipse-SourceBundle: org.eclipse.jgit;version="6.10.2.qualifier";roots="."
diff --git a/org.eclipse.jgit/OSGI-INF/org.eclipse.jgit.internal.util.CleanupService.xml b/org.eclipse.jgit/OSGI-INF/org.eclipse.jgit.internal.util.CleanupService.xml new file mode 100644 index 0000000..8d97374 --- /dev/null +++ b/org.eclipse.jgit/OSGI-INF/org.eclipse.jgit.internal.util.CleanupService.xml
@@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="shutDown" name="org.eclipse.jgit.internal.util.CleanupService"> + <implementation class="org.eclipse.jgit.internal.util.CleanupService"/> +</scr:component> \ No newline at end of file
diff --git a/org.eclipse.jgit/pom.xml b/org.eclipse.jgit/pom.xml index 49a6092..f4e23c8 100644 --- a/org.eclipse.jgit/pom.xml +++ b/org.eclipse.jgit/pom.xml
@@ -20,7 +20,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit</artifactId> @@ -49,7 +49,6 @@ <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> - <version>1.16.0</version> </dependency> </dependencies>
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 bbfd0b0..c54c811 100644 --- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties +++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
@@ -64,8 +64,6 @@ binaryHunkInvalidLength=Binary hunk, line {0}: input corrupt; expected length byte, got 0x{1} binaryHunkLineTooShort=Binary hunk, line {0}: input ended prematurely binaryHunkMissingNewline=Binary hunk, line {0}: input line not terminated by newline -bitmapAccessErrorForPackfile=Error whilst trying to access bitmap file for {} -bitmapFailedToGet=Failed to get bitmap index file {} bitmapMissingObject=Bitmap at {0} is missing {1}. bitmapsMustBePrepared=Bitmaps must be prepared before they may be written. bitmapUseNoopNoListener=Use NOOP instance for no listener @@ -716,6 +714,7 @@ shortReadOfOptionalDIRCExtensionExpectedAnotherBytes=Short read of optional DIRC extension {0}; expected another {1} bytes within the section. shortSkipOfBlock=Short skip of block. shutdownCleanup=Cleanup {} during JVM shutdown +shutdownCleanupFailed=Cleanup during JVM shutdown failed shutdownCleanupListenerFailed=Cleanup of {0} during JVM shutdown failed signatureVerificationError=Signature verification failed signatureVerificationUnavailable=No signature verifier registered
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java index a03ea01..c133219 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java
@@ -17,7 +17,6 @@ import java.util.ArrayList; import java.util.EnumSet; import java.util.HashSet; -import java.util.LinkedList; import java.util.List; import java.util.Set; @@ -164,7 +163,7 @@ private Stage(int number) { */ protected CheckoutCommand(Repository repo) { super(repo); - this.paths = new LinkedList<>(); + this.paths = new ArrayList<>(); } @Override
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java index a1c6478..a353d1a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java
@@ -14,7 +14,7 @@ import java.io.IOException; import java.text.MessageFormat; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -63,7 +63,7 @@ public class CherryPickCommand extends GitCommand<CherryPickResult> { private String reflogPrefix = "cherry-pick:"; //$NON-NLS-1$ - private List<Ref> commits = new LinkedList<>(); + private List<Ref> commits = new ArrayList<>(); private String ourCommitName = null; @@ -102,7 +102,7 @@ public CherryPickResult call() throws GitAPIException, NoMessageException, UnmergedPathsException, ConcurrentRefUpdateException, WrongRepositoryStateException, NoHeadException { RevCommit newHead = null; - List<Ref> cherryPickedRefs = new LinkedList<>(); + List<Ref> cherryPickedRefs = new ArrayList<>(); checkCallable(); try (RevWalk revWalk = new RevWalk(repo)) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java index 483b960..a1a2cc0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java
@@ -16,7 +16,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; -import java.util.LinkedList; import java.util.List; import org.eclipse.jgit.annotations.NonNull; @@ -109,7 +108,7 @@ public class CommitCommand extends GitCommand<RevCommit> { * parents this commit should have. The current HEAD will be in this list * and also all commits mentioned in .git/MERGE_HEAD */ - private List<ObjectId> parents = new LinkedList<>(); + private List<ObjectId> parents = new ArrayList<>(); private String reflogComment;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java index ed4a534..7064f5a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java
@@ -13,9 +13,9 @@ import java.io.IOException; import java.text.MessageFormat; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.Map; @@ -75,7 +75,7 @@ public class MergeCommand extends GitCommand<MergeResult> { private ContentMergeStrategy contentStrategy; - private List<Ref> commits = new LinkedList<>(); + private List<Ref> commits = new ArrayList<>(); private Boolean squash;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java index 757aff8..858bd96 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java
@@ -23,7 +23,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.regex.Matcher; @@ -1120,8 +1119,8 @@ String toAuthorScript(PersonIdent author) { private void popSteps(int numSteps) throws IOException { if (numSteps == 0) return; - List<RebaseTodoLine> todoLines = new LinkedList<>(); - List<RebaseTodoLine> poppedLines = new LinkedList<>(); + List<RebaseTodoLine> todoLines = new ArrayList<>(); + List<RebaseTodoLine> poppedLines = new ArrayList<>(); for (RebaseTodoLine line : repo.readRebaseTodo( rebaseState.getPath(GIT_REBASE_TODO), true)) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java index 225c999..47145a0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java
@@ -11,8 +11,8 @@ import java.io.IOException; import java.text.MessageFormat; +import java.util.ArrayList; import java.util.Collection; -import java.util.LinkedList; import org.eclipse.jgit.api.errors.CheckoutConflictException; import org.eclipse.jgit.api.errors.GitAPIException; @@ -90,7 +90,7 @@ public enum ResetType { private ResetType mode; - private Collection<String> filepaths = new LinkedList<>(); + private Collection<String> filepaths = new ArrayList<>(); private boolean isReflogDisabled;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java index 5231d4a..855c3b1 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java
@@ -13,7 +13,7 @@ import java.io.IOException; import java.text.MessageFormat; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -58,13 +58,13 @@ * >Git documentation about revert</a> */ public class RevertCommand extends GitCommand<RevCommit> { - private List<Ref> commits = new LinkedList<>(); + private List<Ref> commits = new ArrayList<>(); private String ourCommitName = null; private boolean insertChangeId; - private List<Ref> revertedRefs = new LinkedList<>(); + private List<Ref> revertedRefs = new ArrayList<>(); private MergeResult failingResult;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java index 656f36a..7459e72 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java
@@ -13,7 +13,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collection; -import java.util.LinkedList; import java.util.List; import org.eclipse.jgit.api.errors.GitAPIException; @@ -71,7 +70,7 @@ public class RmCommand extends GitCommand<DirCache> { */ public RmCommand(Repository repo) { super(repo); - filepatterns = new LinkedList<>(); + filepatterns = new ArrayList<>(); } /**
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/StatusCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/StatusCommand.java index eab3894..cdd078e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/StatusCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/StatusCommand.java
@@ -10,7 +10,7 @@ package org.eclipse.jgit.api; import java.io.IOException; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import org.eclipse.jgit.api.errors.GitAPIException; @@ -83,7 +83,7 @@ public StatusCommand setIgnoreSubmodules(IgnoreSubmoduleMode mode) { */ public StatusCommand addPath(String path) { if (paths == null) - paths = new LinkedList<>(); + paths = new ArrayList<>(); paths.add(path); return this; }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/CheckoutConflictException.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/CheckoutConflictException.java index 0224b3d..5538711 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/CheckoutConflictException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/CheckoutConflictException.java
@@ -37,7 +37,7 @@ */ package org.eclipse.jgit.api.errors; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; /** @@ -99,7 +99,7 @@ public List<String> getConflictingPaths() { */ CheckoutConflictException addConflictingPath(String conflictingPath) { if (conflictingPaths == null) - conflictingPaths = new LinkedList<>(); + conflictingPaths = new ArrayList<>(); conflictingPaths.add(conflictingPath); return this; }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/Attribute.java b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/Attribute.java index fe3e22a..9c4d870 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/Attribute.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/Attribute.java
@@ -9,6 +9,8 @@ */ package org.eclipse.jgit.attributes; +import org.eclipse.jgit.annotations.Nullable; + /** * Represents an attribute. * <p> @@ -139,6 +141,7 @@ public State getState() { * * @return the attribute value (may be <code>null</code>) */ + @Nullable public String getValue() { return value; }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffDriver.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffDriver.java new file mode 100644 index 0000000..b744444 --- /dev/null +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffDriver.java
@@ -0,0 +1,116 @@ +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. + * and other copyright owners as documented in the project's IP log. + * + * 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.diff; + +import java.util.List; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +/** + * Built-in drivers for various languages, sorted by name. These drivers will be + * used to determine function names for a hunk. + * <p> + * When writing or updating patterns, assume the contents are syntactically + * correct. Patterns can be simple and need not cover all syntactical corner + * cases, as long as they are sufficiently permissive. + * + * @since 6.10.1 + */ +@SuppressWarnings({"ImmutableEnumChecker", "nls"}) +public enum DiffDriver { + /** + * Built-in diff driver for <a href= + * "https://learn.microsoft.com/en-us/cpp/cpp/cpp-language-reference">c++</a> + */ + cpp(List.of( + /* Jump targets or access declarations */ + "^[ \\t]*[A-Za-z_][A-Za-z_0-9]*:\\s*($|/[/*])"), List.of( + /* functions/methods, variables, and compounds at top level */ + "^((::\\s*)?[A-Za-z_].*)$")), + /** + * Built-in diff driver for <a href= + * "https://devicetree-specification.readthedocs.io/en/stable/source-language.html">device + * tree files</a> + */ + dts(List.of(";", "="), List.of( + /* lines beginning with a word optionally preceded by '&' or the root */ + "^[ \\t]*((/[ \\t]*\\{|&?[a-zA-Z_]).*)")), + /** + * Built-in diff driver for <a href= + * "https://docs.oracle.com/javase/specs/jls/se21/html/index.html">java</a> + */ + java(List.of( + "^[ \\t]*(catch|do|for|if|instanceof|new|return|switch|throw|while)"), + List.of( + /* Class, enum, interface, and record declarations */ + "^[ \\t]*(([a-z-]+[ \\t]+)*(class|enum|interface|record)[ \\t]+.*)$", + /* Method definitions; note that constructor signatures are not */ + /* matched because they are indistinguishable from method calls. */ + "^[ \\t]*(([A-Za-z_<>&\\]\\[][?&<>.,A-Za-z_0-9]*[ \\t]+)+[A-Za-z_]" + + "[A-Za-z_0-9]*[ \\t]*\\([^;]*)$")), + /** + * Built-in diff driver for + * <a href="https://docs.python.org/3/reference/index.html">python</a> + */ + python(List.of("^[ \\t]*((class|(async[ \\t]+)?def)[ \\t].*)$")), + /** + * Built-in diff driver for + * <a href="https://doc.rust-lang.org/reference/introduction.html">rust</a> + */ + rust(List.of("^[\\t ]*((pub(\\([^\\)]+\\))?[\\t ]+)?" + + "((async|const|unsafe|extern([\\t ]+\"[^\"]+\"))[\\t ]+)?" + + "(struct|enum|union|mod|trait|fn|impl|macro_rules!)[< \\t]+[^;]*)$")); + + private final List<Pattern> negatePatterns; + + private final List<Pattern> matchPatterns; + + DiffDriver(List<String> negate, List<String> match, int flags) { + if (negate != null) { + this.negatePatterns = negate.stream() + .map(r -> Pattern.compile(r, flags)) + .collect(Collectors.toList()); + } else { + this.negatePatterns = null; + } + this.matchPatterns = match.stream().map(r -> Pattern.compile(r, flags)) + .collect(Collectors.toList()); + } + + DiffDriver(List<String> match) { + this(null, match, 0); + } + + DiffDriver(List<String> negate, List<String> match) { + this(negate, match, 0); + } + + /** + * Returns the list of patterns used to exclude certain lines from being + * considered as function names. + * + * @return the list of negate patterns + */ + public List<Pattern> getNegatePatterns() { + return negatePatterns; + } + + /** + * Returns the list of patterns used to match lines for potential function + * names. + * + * @return the list of match patterns + */ + public List<Pattern> getMatchPatterns() { + return matchPatterns; + } +}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java index 2f472b5..6375a60 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java
@@ -30,7 +30,9 @@ import java.util.Collections; import java.util.List; +import java.util.regex.Pattern; import org.eclipse.jgit.api.errors.CanceledException; +import org.eclipse.jgit.attributes.Attribute; import org.eclipse.jgit.diff.DiffAlgorithm.SupportedAlgorithm; import org.eclipse.jgit.diff.DiffEntry.ChangeType; import org.eclipse.jgit.dircache.DirCacheIterator; @@ -703,7 +705,7 @@ public void format(List<? extends DiffEntry> entries) throws IOException { */ public void format(DiffEntry ent) throws IOException { FormatResult res = createFormatResult(ent); - format(res.header, res.a, res.b); + format(res.header, res.a, res.b, getDiffDriver(ent)); } private static byte[] writeGitLinkText(AbbreviatedObjectId id) { @@ -749,11 +751,14 @@ private String quotePath(String path) { * text source for the post-image version of the content. This * must match the content of * {@link org.eclipse.jgit.patch.FileHeader#getNewId()}. + * @param diffDriver + * the diff driver used to obtain function names in hunk headers * @throws java.io.IOException - * writing to the supplied stream failed. + * writing to the supplied stream failed. + * @since 6.10.1 */ - public void format(FileHeader head, RawText a, RawText b) - throws IOException { + public void format(FileHeader head, RawText a, RawText b, + DiffDriver diffDriver) throws IOException { // Reuse the existing FileHeader as-is by blindly copying its // header lines, but avoiding its hunks. Instead we recreate // the hunks from the text instances we have been supplied. @@ -763,8 +768,49 @@ public void format(FileHeader head, RawText a, RawText b) if (!head.getHunks().isEmpty()) end = head.getHunks().get(0).getStartOffset(); out.write(head.getBuffer(), start, end - start); - if (head.getPatchType() == PatchType.UNIFIED) - format(head.toEditList(), a, b); + if (head.getPatchType() == PatchType.UNIFIED) { + format(head.toEditList(), a, b, diffDriver); + } + } + + /** + * Format a patch script, reusing a previously parsed FileHeader. + * <p> + * This formatter is primarily useful for editing an existing patch script + * to increase or reduce the number of lines of context within the script. + * All header lines are reused as-is from the supplied FileHeader. + * + * @param head + * existing file header containing the header lines to copy. + * @param a + * text source for the pre-image version of the content. This must match + * the content of {@link org.eclipse.jgit.patch.FileHeader#getOldId()}. + * @param b + * text source for the post-image version of the content. This must match + * the content of {@link org.eclipse.jgit.patch.FileHeader#getNewId()}. + * @throws java.io.IOException + * writing to the supplied stream failed. + */ + public void format(FileHeader head, RawText a, RawText b) + throws IOException { + format(head, a, b, null); + } + + /** + * Formats a list of edits in unified diff format + * + * @param edits + * some differences which have been calculated between A and B + * @param a + * the text A which was compared + * @param b + * the text B which was compared + * @throws java.io.IOException + * if an IO error occurred + */ + public void format(EditList edits, RawText a, RawText b) + throws IOException { + format(edits, a, b, null); } /** @@ -776,11 +822,14 @@ public void format(FileHeader head, RawText a, RawText b) * the text A which was compared * @param b * the text B which was compared + * @param diffDriver + * the diff driver used to obtain function names in hunk headers * @throws java.io.IOException * if an IO error occurred + * @since 6.10.1 */ - public void format(EditList edits, RawText a, RawText b) - throws IOException { + public void format(EditList edits, RawText a, RawText b, + DiffDriver diffDriver) throws IOException { for (int curIdx = 0; curIdx < edits.size();) { Edit curEdit = edits.get(curIdx); final int endIdx = findCombinedEnd(edits, curIdx); @@ -791,7 +840,8 @@ public void format(EditList edits, RawText a, RawText b) final int aEnd = (int) Math.min(a.size(), (long) endEdit.getEndA() + context); final int bEnd = (int) Math.min(b.size(), (long) endEdit.getEndB() + context); - writeHunkHeader(aCur, aEnd, bCur, bEnd); + writeHunkHeader(aCur, aEnd, bCur, bEnd, + getFuncName(a, aCur - 1, diffDriver)); while (aCur < aEnd || bCur < bEnd) { if (aCur < curEdit.getBeginA() || endIdx + 1 < curIdx) { @@ -881,8 +931,30 @@ protected void writeRemovedLine(RawText text, int line) * @throws java.io.IOException * if an IO error occurred */ - protected void writeHunkHeader(int aStartLine, int aEndLine, - int bStartLine, int bEndLine) throws IOException { + protected void writeHunkHeader(int aStartLine, int aEndLine, int bStartLine, + int bEndLine) throws IOException { + writeHunkHeader(aStartLine, aEndLine, bStartLine, bEndLine, null); + } + + /** + * Output a hunk header + * + * @param aStartLine + * within first source + * @param aEndLine + * within first source + * @param bStartLine + * within second source + * @param bEndLine + * within second source + * @param funcName + * function name of this hunk + * @throws java.io.IOException + * if an IO error occurred + * @since 6.10.1 + */ + protected void writeHunkHeader(int aStartLine, int aEndLine, int bStartLine, + int bEndLine, String funcName) throws IOException { out.write('@'); out.write('@'); writeRange('-', aStartLine + 1, aEndLine - aStartLine); @@ -890,6 +962,10 @@ protected void writeHunkHeader(int aStartLine, int aEndLine, out.write(' '); out.write('@'); out.write('@'); + if (funcName != null) { + out.write(' '); + out.write(funcName.getBytes()); + } out.write('\n'); } @@ -1247,4 +1323,50 @@ private boolean combineB(List<Edit> e, int i) { private static boolean end(Edit edit, int a, int b) { return edit.getEndA() <= a && edit.getEndB() <= b; } + + private String getFuncName(RawText text, int startAt, + DiffDriver diffDriver) { + if (diffDriver != null) { + while (startAt > 0) { + String line = text.getString(startAt); + startAt--; + if (matchesAny(diffDriver.getNegatePatterns(), line)) { + continue; + } + if (matchesAny(diffDriver.getMatchPatterns(), line)) { + String funcName = line.replaceAll("^[ \\t]+", ""); + return funcName.substring(0, + Math.min(funcName.length(), 80)).trim(); + } + } + } + return null; + } + + private boolean matchesAny(List<Pattern> patterns, String text) { + if (patterns != null) { + for (Pattern p : patterns) { + if (p.matcher(text).find()) { + return true; + } + } + } + return false; + } + + private DiffDriver getDiffDriver(DiffEntry entry) { + Attribute diffAttr = entry.getDiffAttribute(); + if (diffAttr == null) { + return null; + } + String diffAttrValue = diffAttr.getValue(); + if (diffAttrValue == null) { + return null; + } + try { + return DiffDriver.valueOf(diffAttrValue); + } catch (IllegalArgumentException e) { + return null; + } + } }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/PatchIdDiffFormatter.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/PatchIdDiffFormatter.java index 4343642..b401bbe 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/PatchIdDiffFormatter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/PatchIdDiffFormatter.java
@@ -44,8 +44,8 @@ public ObjectId getCalulatedPatchId() { } @Override - protected void writeHunkHeader(int aStartLine, int aEndLine, - int bStartLine, int bEndLine) throws IOException { + protected void writeHunkHeader(int aStartLine, int aEndLine, int bStartLine, + int bEndLine, String funcName) throws IOException { // The hunk header is not taken into account for patch id calculation }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/BareSuperprojectWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/BareSuperprojectWriter.java index 3ce97a4..d191e23 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/BareSuperprojectWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/BareSuperprojectWriter.java
@@ -156,6 +156,9 @@ private void prepareIndex(List<RepoProject> projects, DirCache index, ObjectId objectId; if (ObjectId.isId(proj.getRevision())) { objectId = ObjectId.fromString(proj.getRevision()); + if (config.recordRemoteBranch && proj.getUpstream() != null) { + cfg.setString("submodule", name, "ref", proj.getUpstream()); + } } else { objectId = callback.sha1(url, proj.getRevision()); if (objectId == null && !config.ignoreRemoteFailures) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/ManifestParser.java b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/ManifestParser.java index 8483b77..58b4d3d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/ManifestParser.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/ManifestParser.java
@@ -186,6 +186,10 @@ public void startElement( attributes.getValue("groups")); currentProject .setRecommendShallow(attributes.getValue("clone-depth")); + currentProject + .setUpstream(attributes.getValue("upstream")); + currentProject + .setDestBranch(attributes.getValue("dest-branch")); break; case "remote": String alias = attributes.getValue("alias");
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java index 95c1c8b..9979664 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java
@@ -255,7 +255,7 @@ public RemoteFile readFileWithMode(String uri, String ref, String path) @SuppressWarnings("serial") static class ManifestErrorException extends GitAPIException { ManifestErrorException(Throwable cause) { - super(RepoText.get().invalidManifest, cause); + super(RepoText.get().invalidManifest + " " + cause.getMessage(), cause); } } @@ -615,6 +615,7 @@ private List<RepoProject> renameProjects(List<RepoProject> projects) { p.setUrl(proj.getUrl()); p.addCopyFiles(proj.getCopyFiles()); p.addLinkFiles(proj.getLinkFiles()); + p.setUpstream(proj.getUpstream()); ret.add(p); } }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java index 8deb738..b7a9ac5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java
@@ -38,6 +38,8 @@ public class RepoProject implements Comparable<RepoProject> { private final Set<String> groups; private final List<CopyFile> copyfiles; private final List<LinkFile> linkfiles; + private String upstream; + private String destBranch; private String recommendShallow; private String url; private String defaultRevision; @@ -389,6 +391,56 @@ public void clearLinkFiles() { this.linkfiles.clear(); } + /** + * Return the upstream attribute of the project + * + * @return the upstream value if present, null otherwise. + * + * @since 6.10 + */ + public String getUpstream() { + return this.upstream; + } + + /** + * Return the dest-branch attribute of the project + * + * @return the dest-branch value if present, null otherwise. + * + * @since 7.0 + */ + public String getDestBranch() { + return this.destBranch; + } + + /** + * Set the upstream attribute of the project + * + * Name of the git ref in which a sha1 can be found, when the revision is a + * sha1. + * + * @param upstream value of the attribute in the manifest + * + * @since 6.10 + */ + public void setUpstream(String upstream) { + this.upstream = upstream; + } + + /** + * Set the dest-branch attribute of the project + * + * Name of a Git branch. + * + * @param destBranch + * value of the attribute in the manifest + * + * @since 7.0 + */ + public void setDestBranch(String destBranch) { + this.destBranch = destBranch; + } + private String getPathWithSlash() { if (path.endsWith("/")) { //$NON-NLS-1$ return path;
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 ef464e3..b717550 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
@@ -94,8 +94,6 @@ public static JGitText get() { /***/ public String binaryHunkInvalidLength; /***/ public String binaryHunkLineTooShort; /***/ public String binaryHunkMissingNewline; - /***/ public String bitmapAccessErrorForPackfile; - /***/ public String bitmapFailedToGet; /***/ public String bitmapMissingObject; /***/ public String bitmapsMustBePrepared; /***/ public String bitmapUseNoopNoListener; @@ -745,6 +743,7 @@ public static JGitText get() { /***/ public String shortReadOfOptionalDIRCExtensionExpectedAnotherBytes; /***/ public String shortSkipOfBlock; /***/ public String shutdownCleanup; + /***/ public String shutdownCleanupFailed; /***/ public String shutdownCleanupListenerFailed; /***/ public String signatureVerificationError; /***/ public String signatureVerificationUnavailable;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/diffmergetool/CommandExecutor.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/diffmergetool/CommandExecutor.java index 25b7b8e..c64a844 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/diffmergetool/CommandExecutor.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/diffmergetool/CommandExecutor.java
@@ -165,6 +165,9 @@ private void deleteCommandArray() { if (fs instanceof FS_POSIX) { commandArray = new String[1]; commandArray[0] = commandFile.getCanonicalPath(); + } else if (fs instanceof FS_Win32_Cygwin) { + commandArray = new String[1]; + commandArray[0] = commandFile.getCanonicalPath().replace("\\", "/"); //$NON-NLS-1$ //$NON-NLS-2$ } else if (fs instanceof FS_Win32) { if (useMsys2) { commandArray = new String[3]; @@ -176,9 +179,6 @@ private void deleteCommandArray() { commandArray = new String[1]; commandArray[0] = commandFile.getCanonicalPath(); } - } else if (fs instanceof FS_Win32_Cygwin) { - commandArray = new String[1]; - commandArray[0] = commandFile.getCanonicalPath().replace("\\", "/"); //$NON-NLS-1$ //$NON-NLS-2$ } else { throw new ToolException( "JGit: file system not supported: " + fs.toString()); //$NON-NLS-1$
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphLoader.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphLoader.java index 867d522..7e9220d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphLoader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphLoader.java
@@ -98,6 +98,46 @@ public static CommitGraph open(File graphFile) throws FileNotFoundException, */ public static CommitGraph read(InputStream fd) throws CommitGraphFormatException, IOException { + + boolean readChangedPathFilters; + try { + readChangedPathFilters = SystemReader.getInstance().getJGitConfig() + .getBoolean(ConfigConstants.CONFIG_COMMIT_GRAPH_SECTION, + ConfigConstants.CONFIG_KEY_READ_CHANGED_PATHS, + false); + } catch (ConfigInvalidException e) { + // Use the default value if, for some reason, the config couldn't be + // read. + readChangedPathFilters = false; + } + + return read(fd, readChangedPathFilters); + } + + /** + * Read an existing commit-graph file from a buffered stream. + * <p> + * The format of the file will be automatically detected and a proper access + * implementation for that format will be constructed and returned to the + * caller. The file may or may not be held open by the returned instance. + * + * @param fd + * stream to read the commit-graph file from. The stream must be + * buffered as some small IOs are performed against the stream. + * The caller is responsible for closing the stream. + * + * @param readChangedPathFilters + * enable reading bloom filter chunks. + * + * @return a copy of the commit-graph file in memory + * @throws CommitGraphFormatException + * the commit-graph file's format is different from we expected. + * @throws java.io.IOException + * the stream cannot be read. + */ + public static CommitGraph read(InputStream fd, + boolean readChangedPathFilters) + throws CommitGraphFormatException, IOException { byte[] hdr = new byte[8]; IO.readFully(fd, hdr, 0, hdr.length); @@ -142,17 +182,6 @@ public static CommitGraph read(InputStream fd) chunks.add(new ChunkSegment(id, offset)); } - boolean readChangedPathFilters; - try { - readChangedPathFilters = SystemReader.getInstance() - .getJGitConfig() - .getBoolean(ConfigConstants.CONFIG_COMMIT_GRAPH_SECTION, - ConfigConstants.CONFIG_KEY_READ_CHANGED_PATHS, false); - } catch (ConfigInvalidException e) { - // Use the default value if, for some reason, the config couldn't be read. - readChangedPathFilters = false; - } - CommitGraphBuilder builder = CommitGraphBuilder.builder(); for (int i = 0; i < numberOfChunks; i++) { long chunkOffset = chunks.get(i).offset;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphWriter.java index 1f1c35a..0d9815e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphWriter.java
@@ -31,12 +31,12 @@ import java.io.InterruptedIOException; import java.io.OutputStream; import java.nio.ByteBuffer; +import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Optional; -import java.util.Stack; import org.eclipse.jgit.annotations.NonNull; import org.eclipse.jgit.annotations.Nullable; @@ -336,10 +336,10 @@ private void writeCommitData(CancellableDigestOutputStream out) continue; } - Stack<RevCommit> commitStack = new Stack<>(); + ArrayDeque<RevCommit> commitStack = new ArrayDeque<>(); commitStack.push(cmit); - while (!commitStack.empty()) { + while (!commitStack.isEmpty()) { int maxGeneration = 0; boolean allParentComputed = true; RevCommit current = commitStack.peek();
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/ClockBlockCacheTable.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/ClockBlockCacheTable.java new file mode 100644 index 0000000..d0907bc --- /dev/null +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/ClockBlockCacheTable.java
@@ -0,0 +1,563 @@ +/* + * Copyright (c) 2024, Google LLC and others + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Distribution License v. 1.0 which is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +package org.eclipse.jgit.internal.storage.dfs; + +import java.io.IOException; +import java.time.Duration; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicReferenceArray; +import java.util.concurrent.locks.ReentrantLock; +import java.util.function.Consumer; +import java.util.stream.LongStream; + +import org.eclipse.jgit.internal.JGitText; +import org.eclipse.jgit.internal.storage.dfs.DfsBlockCache.ReadableChannelSupplier; +import org.eclipse.jgit.internal.storage.dfs.DfsBlockCache.Ref; +import org.eclipse.jgit.internal.storage.dfs.DfsBlockCache.RefLoader; +import org.eclipse.jgit.internal.storage.pack.PackExt; + +/** + * Default implementation of the {@link DfsBlockCacheTable}. + * <p> + * This cache implements a clock replacement algorithm, giving each block at + * least one chance to have been accessed during a sweep of the cache to save + * itself from eviction. The number of swipe chances is configurable per pack + * extension. + * <p> + * Entities created by the cache are held under hard references, preventing the + * Java VM from clearing anything. Blocks are discarded by the replacement + * algorithm when adding a new block would cause the cache to exceed its + * configured maximum size. + * <p> + * Whenever a cache miss occurs, loading is invoked by exactly one thread for + * the given <code>(DfsStreamKey,position)</code> key tuple. This is ensured by + * an array of locks, with the tuple hashed to a lock instance. + * <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 + * invocations is also fixed in size. + */ +final class ClockBlockCacheTable implements DfsBlockCacheTable { + /** Number of entries in {@link #table}. */ + private final int tableSize; + + /** Maximum number of bytes the cache should hold. */ + private final long maxBytes; + + /** + * Used to reserve space for blocks. + * <p> + * The value for blockSize must be a power of 2. + */ + private final int blockSize; + + private final Hash hash; + + /** Hash bucket directory; entries are chained below. */ + private final AtomicReferenceArray<HashEntry> table; + + /** + * Locks to prevent concurrent loads for same (PackFile,position) block. The + * number of locks is {@link DfsBlockCacheConfig#getConcurrencyLevel()} to + * cap the overall concurrent block loads. + */ + private final ReentrantLock[] loadLocks; + + /** + * A separate pool of locks per pack extension to prevent concurrent loads + * for same index or bitmap from PackFile. + */ + private final ReentrantLock[][] refLocks; + + /** Protects the clock and its related data. */ + private final ReentrantLock clockLock; + + /** Current position of the clock. */ + private Ref clockHand; + + private final DfsBlockCacheStats dfsBlockCacheStats; + + /** + * A consumer of object reference lock wait time milliseconds. May be used + * to build a metric. + */ + private final Consumer<Long> refLockWaitTime; + + /** Consumer of loading and eviction events of indexes. */ + private final DfsBlockCacheConfig.IndexEventConsumer indexEventConsumer; + + /** Stores timestamps of the last eviction of indexes. */ + private final Map<EvictKey, Long> indexEvictionMap = new ConcurrentHashMap<>(); + + ClockBlockCacheTable(DfsBlockCacheConfig cfg) { + this.tableSize = tableSize(cfg); + if (tableSize < 1) { + throw new IllegalArgumentException( + JGitText.get().tSizeMustBeGreaterOrEqual1); + } + int concurrencyLevel = cfg.getConcurrencyLevel(); + this.maxBytes = cfg.getBlockLimit(); + this.blockSize = cfg.getBlockSize(); + int blockSizeShift = Integer.numberOfTrailingZeros(blockSize); + this.hash = new Hash(blockSizeShift); + table = new AtomicReferenceArray<>(tableSize); + + loadLocks = new ReentrantLock[concurrencyLevel]; + for (int i = 0; i < loadLocks.length; i++) { + loadLocks[i] = new ReentrantLock(/* fair= */ true); + } + refLocks = new ReentrantLock[PackExt.values().length][concurrencyLevel]; + for (int i = 0; i < PackExt.values().length; i++) { + for (int j = 0; j < concurrencyLevel; ++j) { + refLocks[i][j] = new ReentrantLock(/* fair= */ true); + } + } + + clockLock = new ReentrantLock(/* fair= */ true); + String none = ""; //$NON-NLS-1$ + clockHand = new Ref<>( + DfsStreamKey.of(new DfsRepositoryDescription(none), none, null), + -1, 0, null); + clockHand.next = clockHand; + + this.dfsBlockCacheStats = new DfsBlockCacheStats(); + this.refLockWaitTime = cfg.getRefLockWaitTimeConsumer(); + this.indexEventConsumer = cfg.getIndexEventConsumer(); + } + + @Override + public DfsBlockCacheStats getDfsBlockCacheStats() { + return dfsBlockCacheStats; + } + + @Override + public boolean hasBlock0(DfsStreamKey key) { + HashEntry e1 = table.get(slot(key, 0)); + DfsBlock v = scan(e1, key, 0); + return v != null && v.contains(key, 0); + } + + @Override + public DfsBlock getOrLoad(BlockBasedFile file, long position, DfsReader ctx, + ReadableChannelSupplier fileChannel) throws IOException { + final long requestedPosition = position; + position = file.alignToBlock(position); + + DfsStreamKey key = file.key; + int slot = slot(key, position); + HashEntry e1 = table.get(slot); + DfsBlock v = scan(e1, key, position); + if (v != null && v.contains(key, requestedPosition)) { + ctx.stats.blockCacheHit++; + dfsBlockCacheStats.incrementHit(key); + return v; + } + + reserveSpace(blockSize, key); + ReentrantLock regionLock = lockFor(key, position); + regionLock.lock(); + try { + HashEntry e2 = table.get(slot); + if (e2 != e1) { + v = scan(e2, key, position); + if (v != null) { + ctx.stats.blockCacheHit++; + dfsBlockCacheStats.incrementHit(key); + creditSpace(blockSize, key); + return v; + } + } + + dfsBlockCacheStats.incrementMiss(key); + boolean credit = true; + try { + v = file.readOneBlock(position, ctx, fileChannel.get()); + credit = false; + } finally { + if (credit) { + creditSpace(blockSize, key); + } + } + if (position != v.start) { + // The file discovered its blockSize and adjusted. + position = v.start; + slot = slot(key, position); + e2 = table.get(slot); + } + + Ref<DfsBlock> ref = new Ref<>(key, position, v.size(), v); + ref.markHotter(); + for (;;) { + HashEntry n = new HashEntry(HashEntry.clean(e2), ref); + if (table.compareAndSet(slot, e2, n)) { + break; + } + e2 = table.get(slot); + } + addToClock(ref, blockSize - v.size()); + } finally { + regionLock.unlock(); + } + + // If the block size changed from the default, it is possible the + // block + // that was loaded is the wrong block for the requested position. + if (v.contains(file.key, requestedPosition)) { + return v; + } + return getOrLoad(file, requestedPosition, ctx, fileChannel); + } + + @Override + public <T> Ref<T> getOrLoadRef(DfsStreamKey key, long position, + RefLoader<T> loader) throws IOException { + long start = System.nanoTime(); + int slot = slot(key, position); + HashEntry e1 = table.get(slot); + Ref<T> ref = scanRef(e1, key, position); + if (ref != null) { + dfsBlockCacheStats.incrementHit(key); + reportIndexRequested(ref, true /* cacheHit= */, start); + return ref; + } + + ReentrantLock regionLock = lockForRef(key); + long lockStart = System.currentTimeMillis(); + regionLock.lock(); + try { + HashEntry e2 = table.get(slot); + if (e2 != e1) { + ref = scanRef(e2, key, position); + if (ref != null) { + dfsBlockCacheStats.incrementHit(key); + reportIndexRequested(ref, true /* cacheHit= */, start); + return ref; + } + } + + if (refLockWaitTime != null) { + refLockWaitTime.accept( + Long.valueOf(System.currentTimeMillis() - lockStart)); + } + dfsBlockCacheStats.incrementMiss(key); + ref = loader.load(); + ref.markHotter(); + // Reserve after loading to get the size of the object + reserveSpace(ref.size, key); + for (;;) { + HashEntry n = new HashEntry(HashEntry.clean(e2), ref); + if (table.compareAndSet(slot, e2, n)) { + break; + } + e2 = table.get(slot); + } + addToClock(ref, 0); + } finally { + regionLock.unlock(); + } + reportIndexRequested(ref, /* cacheHit= */ false, start); + return ref; + } + + @Override + public void put(DfsBlock v) { + put(v.stream, v.start, v.size(), v); + } + + @Override + public <T> Ref<T> put(DfsStreamKey key, long pos, long size, T v) { + int slot = slot(key, pos); + HashEntry e1 = table.get(slot); + Ref<T> ref = scanRef(e1, key, pos); + if (ref != null) { + return ref; + } + + reserveSpace(size, key); + ReentrantLock regionLock = lockFor(key, pos); + regionLock.lock(); + try { + HashEntry e2 = table.get(slot); + if (e2 != e1) { + ref = scanRef(e2, key, pos); + if (ref != null) { + creditSpace(size, key); + return ref; + } + } + + ref = new Ref<>(key, pos, size, v); + ref.markHotter(); + for (;;) { + HashEntry n = new HashEntry(HashEntry.clean(e2), ref); + if (table.compareAndSet(slot, e2, n)) { + break; + } + e2 = table.get(slot); + } + addToClock(ref, 0); + } finally { + regionLock.unlock(); + } + return ref; + } + + @Override + public <T> Ref<T> putRef(DfsStreamKey key, long size, T v) { + return put(key, 0, size, v); + } + + @Override + public boolean contains(DfsStreamKey key, long position) { + return scan(table.get(slot(key, position)), key, position) != null; + } + + @SuppressWarnings("unchecked") + @Override + public <T> T get(DfsStreamKey key, long position) { + T val = (T) scan(table.get(slot(key, position)), key, position); + if (val == null) { + dfsBlockCacheStats.incrementMiss(key); + } else { + dfsBlockCacheStats.incrementHit(key); + } + return val; + } + + private int slot(DfsStreamKey key, long position) { + return (hash.hash(key.hash, position) >>> 1) % tableSize; + } + + @SuppressWarnings("unchecked") + private void reserveSpace(long reserve, DfsStreamKey key) { + clockLock.lock(); + try { + long live = LongStream.of(dfsBlockCacheStats.getCurrentSize()).sum() + + reserve; + if (maxBytes < live) { + Ref prev = clockHand; + Ref hand = clockHand.next; + do { + if (hand.isHot()) { + // Value was recently touched. Cache is still hot so + // give it another chance, but cool it down a bit. + hand.markColder(); + prev = hand; + hand = hand.next; + continue; + } else if (prev == hand) { + break; + } + + // No recent access since last scan, kill + // value and remove from clock. + Ref dead = hand; + hand = hand.next; + prev.next = hand; + dead.next = null; + dead.value = null; + live -= dead.size; + dfsBlockCacheStats.addToLiveBytes(dead.key, -dead.size); + dfsBlockCacheStats.incrementEvict(dead.key); + reportIndexEvicted(dead); + } while (maxBytes < live); + clockHand = prev; + } + dfsBlockCacheStats.addToLiveBytes(key, reserve); + } finally { + clockLock.unlock(); + } + } + + private void creditSpace(long credit, DfsStreamKey key) { + clockLock.lock(); + try { + dfsBlockCacheStats.addToLiveBytes(key, -credit); + } finally { + clockLock.unlock(); + } + } + + @SuppressWarnings("unchecked") + private void addToClock(Ref ref, long credit) { + clockLock.lock(); + try { + if (credit != 0) { + dfsBlockCacheStats.addToLiveBytes(ref.key, -credit); + } + Ref ptr = clockHand; + ref.next = ptr.next; + ptr.next = ref; + clockHand = ref; + } finally { + clockLock.unlock(); + } + } + + private <T> T scan(HashEntry n, DfsStreamKey key, long position) { + Ref<T> r = scanRef(n, key, position); + return r != null ? r.get() : null; + } + + @SuppressWarnings("unchecked") + private <T> Ref<T> scanRef(HashEntry n, DfsStreamKey key, long position) { + for (; n != null; n = n.next) { + Ref<T> r = n.ref; + if (r.position == position && r.key.equals(key)) { + return r.get() != null ? r : null; + } + } + return null; + } + + private ReentrantLock lockFor(DfsStreamKey key, long position) { + return loadLocks[(hash.hash(key.hash, position) >>> 1) + % loadLocks.length]; + } + + private ReentrantLock lockForRef(DfsStreamKey key) { + int slot = (key.hash >>> 1) % refLocks[key.packExtPos].length; + return refLocks[key.packExtPos][slot]; + } + + private void reportIndexRequested(Ref<?> ref, boolean cacheHit, + long start) { + if (indexEventConsumer == null || !isIndexExtPos(ref.key.packExtPos)) { + return; + } + EvictKey evictKey = createEvictKey(ref); + Long prevEvictedTime = indexEvictionMap.get(evictKey); + long now = System.nanoTime(); + long sinceLastEvictionNanos = prevEvictedTime == null ? 0L + : now - prevEvictedTime.longValue(); + indexEventConsumer.acceptRequestedEvent(ref.key.packExtPos, cacheHit, + (now - start) / 1000L /* micros */, ref.size, + Duration.ofNanos(sinceLastEvictionNanos)); + } + + private void reportIndexEvicted(Ref<?> dead) { + if (indexEventConsumer == null + || !indexEventConsumer.shouldReportEvictedEvent() + || !isIndexExtPos(dead.key.packExtPos)) { + return; + } + EvictKey evictKey = createEvictKey(dead); + Long prevEvictedTime = indexEvictionMap.get(evictKey); + long now = System.nanoTime(); + long sinceLastEvictionNanos = prevEvictedTime == null ? 0L + : now - prevEvictedTime.longValue(); + indexEvictionMap.put(evictKey, Long.valueOf(now)); + indexEventConsumer.acceptEvictedEvent(dead.key.packExtPos, dead.size, + dead.getTotalHitCount(), + Duration.ofNanos(sinceLastEvictionNanos)); + } + + private static final class HashEntry { + /** Next entry in the hash table's chain list. */ + final HashEntry next; + + /** The referenced object. */ + final Ref ref; + + HashEntry(HashEntry n, Ref r) { + next = n; + ref = r; + } + + private static HashEntry clean(HashEntry top) { + while (top != null && top.ref.next == null) { + top = top.next; + } + if (top == null) { + return null; + } + HashEntry n = clean(top.next); + return n == top.next ? top : new HashEntry(n, top.ref); + } + } + + private EvictKey createEvictKey(Ref<?> ref) { + return new EvictKey(hash, ref); + } + + private static boolean isIndexExtPos(int packExtPos) { + return packExtPos == PackExt.INDEX.getPosition() + || packExtPos == PackExt.REVERSE_INDEX.getPosition() + || packExtPos == PackExt.BITMAP_INDEX.getPosition(); + } + + private static int tableSize(DfsBlockCacheConfig cfg) { + final int wsz = cfg.getBlockSize(); + final long limit = cfg.getBlockLimit(); + if (wsz <= 0) { + throw new IllegalArgumentException( + JGitText.get().invalidWindowSize); + } + if (limit < wsz) { + throw new IllegalArgumentException( + JGitText.get().windowSizeMustBeLesserThanLimit); + } + return (int) Math.min(5 * (limit / wsz) / 2, Integer.MAX_VALUE); + } + + private static final class Hash { + /** + * As {@link #blockSize} is a power of 2, bits to shift for a / + * blockSize. + */ + private final int blockSizeShift; + + Hash(int blockSizeShift) { + this.blockSizeShift = blockSizeShift; + } + + int hash(int packHash, long off) { + return packHash + (int) (off >>> blockSizeShift); + } + } + + private static final class EvictKey { + /** + * Provides the hash function to be used for this key's hashCode method. + */ + private final Hash hash; + + private final int keyHash; + + private final int packExtPos; + + private final long position; + + EvictKey(Hash hash, Ref<?> ref) { + this.hash = hash; + keyHash = ref.key.hash; + packExtPos = ref.key.packExtPos; + position = ref.position; + } + + @Override + public boolean equals(Object object) { + if (object instanceof EvictKey) { + EvictKey other = (EvictKey) object; + return keyHash == other.keyHash + && packExtPos == other.packExtPos + && position == other.position; + } + return false; + } + + @Override + public int hashCode() { + return hash.hash(keyHash, position); + } + } +}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java index f7c460c..56719cf 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java
@@ -12,18 +12,9 @@ package org.eclipse.jgit.internal.storage.dfs; import java.io.IOException; -import java.time.Duration; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; -import java.util.concurrent.atomic.AtomicReference; -import java.util.concurrent.atomic.AtomicReferenceArray; -import java.util.concurrent.locks.ReentrantLock; -import java.util.function.Consumer; import java.util.stream.LongStream; -import org.eclipse.jgit.internal.JGitText; import org.eclipse.jgit.internal.storage.pack.PackExt; /** @@ -36,31 +27,14 @@ * reads of only tiny slices of a file, the DfsBlockCache tries to smooth out * these tiny reads into larger block-sized IO operations. * <p> - * Whenever a cache miss occurs, loading is invoked by exactly one thread for - * the given <code>(DfsStreamKey,position)</code> key tuple. This is ensured by - * an array of locks, with the tuple hashed to a lock instance. - * <p> * Its too expensive during object access to be accurate with a least recently * used (LRU) algorithm. Strictly ordering every read is a lot of overhead that - * typically doesn't yield a corresponding benefit to the application. This - * cache implements a clock replacement algorithm, giving each block at least - * one chance to have been accessed during a sweep of the cache to save itself - * from eviction. The number of swipe chances is configurable per pack - * extension. - * <p> - * Entities created by the cache are held under hard references, preventing the - * Java VM from clearing anything. Blocks are discarded by the replacement - * algorithm when adding a new block would cause the cache to exceed its - * configured maximum size. + * typically doesn't yield a corresponding benefit to the application. * <p> * The key tuple is passed through to methods as a pair of parameters rather * than as a single Object, thus reducing the transient memory allocations of * callers. It is more efficient to avoid the allocation, as we can't be 100% * sure that a JIT would be able to stack-allocate a key tuple. - * <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 - * invocations is also fixed in size. */ public final class DfsBlockCache { private static volatile DfsBlockCache cache; @@ -94,24 +68,7 @@ public static DfsBlockCache getInstance() { return cache; } - /** Number of entries in {@link #table}. */ - private final int tableSize; - - /** Hash bucket directory; entries are chained below. */ - private final AtomicReferenceArray<HashEntry> table; - - /** - * Locks to prevent concurrent loads for same (PackFile,position) block. The - * number of locks is {@link DfsBlockCacheConfig#getConcurrencyLevel()} to - * cap the overall concurrent block loads. - */ - private final ReentrantLock[] loadLocks; - - /** - * A separate pool of locks per pack extension to prevent concurrent loads - * for same index or bitmap from PackFile. - */ - private final ReentrantLock[][] refLocks; + private final DfsBlockCacheTable dfsBlockCacheTable; /** Maximum number of bytes the cache should hold. */ private final long maxBytes; @@ -131,89 +88,16 @@ public static DfsBlockCache getInstance() { */ private final int blockSize; - /** As {@link #blockSize} is a power of 2, bits to shift for a / blockSize. */ - private final int blockSizeShift; - - /** - * Number of times a block was found in the cache, per pack file extension. - */ - private final AtomicReference<AtomicLong[]> statHit; - - /** - * Number of times a block was not found, and had to be loaded, per pack - * file extension. - */ - private final AtomicReference<AtomicLong[]> statMiss; - - /** - * Number of blocks evicted due to cache being full, per pack file - * extension. - */ - private final AtomicReference<AtomicLong[]> statEvict; - - /** - * Number of bytes currently loaded in the cache, per pack file extension. - */ - private final AtomicReference<AtomicLong[]> liveBytes; - - /** Protects the clock and its related data. */ - private final ReentrantLock clockLock; - - /** - * A consumer of object reference lock wait time milliseconds. May be used to build a metric. - */ - private final Consumer<Long> refLockWaitTime; - - /** Current position of the clock. */ - private Ref clockHand; - /** Limits of cache hot count per pack file extension. */ private final int[] cacheHotLimits = new int[PackExt.values().length]; - /** Consumer of loading and eviction events of indexes. */ - private final DfsBlockCacheConfig.IndexEventConsumer indexEventConsumer; - - /** Stores timestamps of the last eviction of indexes. */ - private final Map<EvictKey, Long> indexEvictionMap = new ConcurrentHashMap<>(); - - @SuppressWarnings("unchecked") private DfsBlockCache(DfsBlockCacheConfig cfg) { - tableSize = tableSize(cfg); - if (tableSize < 1) { - throw new IllegalArgumentException(JGitText.get().tSizeMustBeGreaterOrEqual1); - } - - table = new AtomicReferenceArray<>(tableSize); - int concurrencyLevel = cfg.getConcurrencyLevel(); - loadLocks = new ReentrantLock[concurrencyLevel]; - for (int i = 0; i < loadLocks.length; i++) { - loadLocks[i] = new ReentrantLock(true /* fair */); - } - refLocks = new ReentrantLock[PackExt.values().length][concurrencyLevel]; - for (int i = 0; i < PackExt.values().length; i++) { - for (int j = 0; j < concurrencyLevel; ++j) { - refLocks[i][j] = new ReentrantLock(true /* fair */); - } - } - maxBytes = cfg.getBlockLimit(); - maxStreamThroughCache = (long) (maxBytes * cfg.getStreamRatio()); blockSize = cfg.getBlockSize(); - blockSizeShift = Integer.numberOfTrailingZeros(blockSize); + double streamRatio = cfg.getStreamRatio(); + maxStreamThroughCache = (long) (maxBytes * streamRatio); - clockLock = new ReentrantLock(true /* fair */); - String none = ""; //$NON-NLS-1$ - clockHand = new Ref<>( - DfsStreamKey.of(new DfsRepositoryDescription(none), none, null), - -1, 0, null); - clockHand.next = clockHand; - - statHit = new AtomicReference<>(newCounters()); - statMiss = new AtomicReference<>(newCounters()); - statEvict = new AtomicReference<>(newCounters()); - liveBytes = new AtomicReference<>(newCounters()); - - refLockWaitTime = cfg.getRefLockWaitTimeConsumer(); + dfsBlockCacheTable = new ClockBlockCacheTable(cfg); for (int i = 0; i < PackExt.values().length; ++i) { Integer limit = cfg.getCacheHotMap().get(PackExt.values()[i]); @@ -223,7 +107,6 @@ private DfsBlockCache(DfsBlockCacheConfig cfg) { cacheHotLimits[i] = DfsBlockCacheConfig.DEFAULT_CACHE_HOT_MAX; } } - indexEventConsumer = cfg.getIndexEventConsumer(); } boolean shouldCopyThroughCache(long length) { @@ -236,7 +119,7 @@ boolean shouldCopyThroughCache(long length) { * @return total number of bytes in the cache, per pack file extension. */ public long[] getCurrentSize() { - return getStatVals(liveBytes); + return dfsBlockCacheTable.getDfsBlockCacheStats().getCurrentSize(); } /** @@ -255,7 +138,7 @@ public long getFillPercentage() { * extension. */ public long[] getHitCount() { - return getStatVals(statHit); + return dfsBlockCacheTable.getDfsBlockCacheStats().getHitCount(); } /** @@ -266,7 +149,7 @@ public long getFillPercentage() { * extension. */ public long[] getMissCount() { - return getStatVals(statMiss); + return dfsBlockCacheTable.getDfsBlockCacheStats().getMissCount(); } /** @@ -275,16 +158,8 @@ public long getFillPercentage() { * @return total number of requests (hit + miss), per pack file extension. */ public long[] getTotalRequestCount() { - AtomicLong[] hit = statHit.get(); - AtomicLong[] miss = statMiss.get(); - long[] cnt = new long[Math.max(hit.length, miss.length)]; - for (int i = 0; i < hit.length; i++) { - cnt[i] += hit[i].get(); - } - for (int i = 0; i < miss.length; i++) { - cnt[i] += miss[i].get(); - } - return cnt; + return dfsBlockCacheTable.getDfsBlockCacheStats() + .getTotalRequestCount(); } /** @@ -293,22 +168,7 @@ public long getFillPercentage() { * @return hit ratios */ public long[] getHitRatio() { - AtomicLong[] hit = statHit.get(); - AtomicLong[] miss = statMiss.get(); - long[] ratio = new long[Math.max(hit.length, miss.length)]; - for (int i = 0; i < ratio.length; i++) { - if (i >= hit.length) { - ratio[i] = 0; - } else if (i >= miss.length) { - ratio[i] = 100; - } else { - long hitVal = hit[i].get(); - long missVal = miss[i].get(); - long total = hitVal + missVal; - ratio[i] = total == 0 ? 0 : hitVal * 100 / total; - } - } - return ratio; + return dfsBlockCacheTable.getDfsBlockCacheStats().getHitRatio(); } /** @@ -319,7 +179,7 @@ public long getFillPercentage() { * file extension. */ public long[] getEvictions() { - return getStatVals(statEvict); + return dfsBlockCacheTable.getDfsBlockCacheStats().getEvictions(); } /** @@ -334,31 +194,13 @@ public long getFillPercentage() { * @return true if block 0 (the first block) is in the cache. */ public boolean hasBlock0(DfsStreamKey key) { - HashEntry e1 = table.get(slot(key, 0)); - DfsBlock v = scan(e1, key, 0); - return v != null && v.contains(key, 0); - } - - private int hash(int packHash, long off) { - return packHash + (int) (off >>> blockSizeShift); + return dfsBlockCacheTable.hasBlock0(key); } int getBlockSize() { return blockSize; } - private static int tableSize(DfsBlockCacheConfig cfg) { - final int wsz = cfg.getBlockSize(); - final long limit = cfg.getBlockLimit(); - if (wsz <= 0) { - throw new IllegalArgumentException(JGitText.get().invalidWindowSize); - } - if (limit < wsz) { - throw new IllegalArgumentException(JGitText.get().windowSizeMustBeLesserThanLimit); - } - return (int) Math.min(5 * (limit / wsz) / 2, Integer.MAX_VALUE); - } - /** * Look up a cached object, creating and loading it if it doesn't exist. * @@ -376,139 +218,11 @@ private static int tableSize(DfsBlockCacheConfig cfg) { */ DfsBlock getOrLoad(BlockBasedFile file, long position, DfsReader ctx, ReadableChannelSupplier fileChannel) throws IOException { - final long requestedPosition = position; - position = file.alignToBlock(position); - - DfsStreamKey key = file.key; - int slot = slot(key, position); - HashEntry e1 = table.get(slot); - DfsBlock v = scan(e1, key, position); - if (v != null && v.contains(key, requestedPosition)) { - ctx.stats.blockCacheHit++; - getStat(statHit, key).incrementAndGet(); - return v; - } - - reserveSpace(blockSize, key); - ReentrantLock regionLock = lockFor(key, position); - regionLock.lock(); - try { - HashEntry e2 = table.get(slot); - if (e2 != e1) { - v = scan(e2, key, position); - if (v != null) { - ctx.stats.blockCacheHit++; - getStat(statHit, key).incrementAndGet(); - creditSpace(blockSize, key); - return v; - } - } - - getStat(statMiss, key).incrementAndGet(); - boolean credit = true; - try { - v = file.readOneBlock(position, ctx, fileChannel.get()); - credit = false; - } finally { - if (credit) { - creditSpace(blockSize, key); - } - } - if (position != v.start) { - // The file discovered its blockSize and adjusted. - position = v.start; - slot = slot(key, position); - e2 = table.get(slot); - } - - Ref<DfsBlock> ref = new Ref<>(key, position, v.size(), v); - ref.markHotter(); - for (;;) { - HashEntry n = new HashEntry(clean(e2), ref); - if (table.compareAndSet(slot, e2, n)) { - break; - } - e2 = table.get(slot); - } - addToClock(ref, blockSize - v.size()); - } finally { - regionLock.unlock(); - } - - // If the block size changed from the default, it is possible the block - // that was loaded is the wrong block for the requested position. - if (v.contains(file.key, requestedPosition)) { - return v; - } - return getOrLoad(file, requestedPosition, ctx, fileChannel); - } - - @SuppressWarnings("unchecked") - private void reserveSpace(long reserve, DfsStreamKey key) { - clockLock.lock(); - try { - long live = LongStream.of(getCurrentSize()).sum() + reserve; - if (maxBytes < live) { - Ref prev = clockHand; - Ref hand = clockHand.next; - do { - if (hand.isHot()) { - // Value was recently touched. Cache is still hot so - // give it another chance, but cool it down a bit. - hand.markColder(); - prev = hand; - hand = hand.next; - continue; - } else if (prev == hand) - break; - - // No recent access since last scan, kill - // value and remove from clock. - Ref dead = hand; - hand = hand.next; - prev.next = hand; - dead.next = null; - dead.value = null; - live -= dead.size; - getStat(liveBytes, dead.key).addAndGet(-dead.size); - getStat(statEvict, dead.key).incrementAndGet(); - reportIndexEvicted(dead); - } while (maxBytes < live); - clockHand = prev; - } - getStat(liveBytes, key).addAndGet(reserve); - } finally { - clockLock.unlock(); - } - } - - private void creditSpace(long credit, DfsStreamKey key) { - clockLock.lock(); - try { - getStat(liveBytes, key).addAndGet(-credit); - } finally { - clockLock.unlock(); - } - } - - @SuppressWarnings("unchecked") - private void addToClock(Ref ref, long credit) { - clockLock.lock(); - try { - if (credit != 0) { - getStat(liveBytes, ref.key).addAndGet(-credit); - } - Ref ptr = clockHand; - ref.next = ptr.next; - ptr.next = ref; - clockHand = ref; - } finally { - clockLock.unlock(); - } + return dfsBlockCacheTable.getOrLoad(file, position, ctx, fileChannel); } void put(DfsBlock v) { - put(v.stream, v.start, v.size(), v); + dfsBlockCacheTable.put(v); } /** @@ -524,252 +238,41 @@ void put(DfsBlock v) { * @throws IOException * the reference was not in the cache and could not be loaded. */ - <T> Ref<T> getOrLoadRef( - DfsStreamKey key, long position, RefLoader<T> loader) - throws IOException { - long start = System.nanoTime(); - int slot = slot(key, position); - HashEntry e1 = table.get(slot); - Ref<T> ref = scanRef(e1, key, position); - if (ref != null) { - getStat(statHit, key).incrementAndGet(); - reportIndexRequested(ref, true /* cacheHit */, start); - return ref; - } - - ReentrantLock regionLock = lockForRef(key); - long lockStart = System.currentTimeMillis(); - regionLock.lock(); - try { - HashEntry e2 = table.get(slot); - if (e2 != e1) { - ref = scanRef(e2, key, position); - if (ref != null) { - getStat(statHit, key).incrementAndGet(); - reportIndexRequested(ref, true /* cacheHit */, - start); - return ref; - } - } - - if (refLockWaitTime != null) { - refLockWaitTime.accept( - Long.valueOf(System.currentTimeMillis() - lockStart)); - } - getStat(statMiss, key).incrementAndGet(); - ref = loader.load(); - ref.markHotter(); - // Reserve after loading to get the size of the object - reserveSpace(ref.size, key); - for (;;) { - HashEntry n = new HashEntry(clean(e2), ref); - if (table.compareAndSet(slot, e2, n)) { - break; - } - e2 = table.get(slot); - } - addToClock(ref, 0); - } finally { - regionLock.unlock(); - } - reportIndexRequested(ref, false /* cacheHit */, start); - return ref; + <T> Ref<T> getOrLoadRef(DfsStreamKey key, long position, + RefLoader<T> loader) throws IOException { + return dfsBlockCacheTable.getOrLoadRef(key, position, loader); } <T> Ref<T> putRef(DfsStreamKey key, long size, T v) { - return put(key, 0, size, v); + return dfsBlockCacheTable.putRef(key, size, v); } <T> Ref<T> put(DfsStreamKey key, long pos, long size, T v) { - int slot = slot(key, pos); - HashEntry e1 = table.get(slot); - Ref<T> ref = scanRef(e1, key, pos); - if (ref != null) { - return ref; - } - - reserveSpace(size, key); - ReentrantLock regionLock = lockFor(key, pos); - regionLock.lock(); - try { - HashEntry e2 = table.get(slot); - if (e2 != e1) { - ref = scanRef(e2, key, pos); - if (ref != null) { - creditSpace(size, key); - return ref; - } - } - - ref = new Ref<>(key, pos, size, v); - ref.markHotter(); - for (;;) { - HashEntry n = new HashEntry(clean(e2), ref); - if (table.compareAndSet(slot, e2, n)) { - break; - } - e2 = table.get(slot); - } - addToClock(ref, 0); - } finally { - regionLock.unlock(); - } - return ref; + return dfsBlockCacheTable.put(key, pos, size, v); } boolean contains(DfsStreamKey key, long position) { - return scan(table.get(slot(key, position)), key, position) != null; + return dfsBlockCacheTable.contains(key, position); } - @SuppressWarnings("unchecked") <T> T get(DfsStreamKey key, long position) { - T val = (T) scan(table.get(slot(key, position)), key, position); - if (val == null) { - getStat(statMiss, key).incrementAndGet(); - } else { - getStat(statHit, key).incrementAndGet(); - } - return val; - } - - private <T> T scan(HashEntry n, DfsStreamKey key, long position) { - Ref<T> r = scanRef(n, key, position); - return r != null ? r.get() : null; - } - - @SuppressWarnings("unchecked") - private <T> Ref<T> scanRef(HashEntry n, DfsStreamKey key, long position) { - for (; n != null; n = n.next) { - Ref<T> r = n.ref; - if (r.position == position && r.key.equals(key)) { - return r.get() != null ? r : null; - } - } - return null; - } - - private int slot(DfsStreamKey key, long position) { - return (hash(key.hash, position) >>> 1) % tableSize; - } - - private ReentrantLock lockFor(DfsStreamKey key, long position) { - return loadLocks[(hash(key.hash, position) >>> 1) % loadLocks.length]; - } - - private ReentrantLock lockForRef(DfsStreamKey key) { - int slot = (key.hash >>> 1) % refLocks[key.packExtPos].length; - return refLocks[key.packExtPos][slot]; - } - - private static AtomicLong[] newCounters() { - AtomicLong[] ret = new AtomicLong[PackExt.values().length]; - for (int i = 0; i < ret.length; i++) { - ret[i] = new AtomicLong(); - } - return ret; - } - - private static AtomicLong getStat(AtomicReference<AtomicLong[]> stats, - DfsStreamKey key) { - int pos = key.packExtPos; - while (true) { - AtomicLong[] vals = stats.get(); - if (pos < vals.length) { - return vals[pos]; - } - AtomicLong[] expect = vals; - vals = new AtomicLong[Math.max(pos + 1, PackExt.values().length)]; - System.arraycopy(expect, 0, vals, 0, expect.length); - for (int i = expect.length; i < vals.length; i++) { - vals[i] = new AtomicLong(); - } - if (stats.compareAndSet(expect, vals)) { - return vals[pos]; - } - } - } - - private static long[] getStatVals(AtomicReference<AtomicLong[]> stat) { - AtomicLong[] stats = stat.get(); - long[] cnt = new long[stats.length]; - for (int i = 0; i < stats.length; i++) { - cnt[i] = stats[i].get(); - } - return cnt; - } - - private static HashEntry clean(HashEntry top) { - while (top != null && top.ref.next == null) { - top = top.next; - } - if (top == null) { - return null; - } - HashEntry n = clean(top.next); - return n == top.next ? top : new HashEntry(n, top.ref); - } - - private void reportIndexRequested(Ref<?> ref, boolean cacheHit, - long start) { - if (indexEventConsumer == null - || !isIndexExtPos(ref.key.packExtPos)) { - return; - } - EvictKey evictKey = new EvictKey(ref); - Long prevEvictedTime = indexEvictionMap.get(evictKey); - long now = System.nanoTime(); - long sinceLastEvictionNanos = prevEvictedTime == null ? 0L - : now - prevEvictedTime.longValue(); - indexEventConsumer.acceptRequestedEvent(ref.key.packExtPos, cacheHit, - (now - start) / 1000L /* micros */, ref.size, - Duration.ofNanos(sinceLastEvictionNanos)); - } - - private void reportIndexEvicted(Ref<?> dead) { - if (indexEventConsumer == null - || !indexEventConsumer.shouldReportEvictedEvent() - || !isIndexExtPos(dead.key.packExtPos)) { - return; - } - EvictKey evictKey = new EvictKey(dead); - Long prevEvictedTime = indexEvictionMap.get(evictKey); - long now = System.nanoTime(); - long sinceLastEvictionNanos = prevEvictedTime == null ? 0L - : now - prevEvictedTime.longValue(); - indexEvictionMap.put(evictKey, Long.valueOf(now)); - indexEventConsumer.acceptEvictedEvent(dead.key.packExtPos, dead.size, - dead.totalHitCount.get(), - Duration.ofNanos(sinceLastEvictionNanos)); - } - - private static boolean isIndexExtPos(int packExtPos) { - return packExtPos == PackExt.INDEX.getPosition() - || packExtPos == PackExt.REVERSE_INDEX.getPosition() - || packExtPos == PackExt.BITMAP_INDEX.getPosition(); - } - - private static final class HashEntry { - /** Next entry in the hash table's chain list. */ - final HashEntry next; - - /** The referenced object. */ - final Ref ref; - - HashEntry(HashEntry n, Ref r) { - next = n; - ref = r; - } + return dfsBlockCacheTable.get(key, position); } static final class Ref<T> { final DfsStreamKey key; + final long position; + final long size; + volatile T value; + Ref next; private volatile int hotCount; - private AtomicInteger totalHitCount = new AtomicInteger(); + + private final AtomicInteger totalHitCount = new AtomicInteger(); Ref(DfsStreamKey key, long position, long size, T v) { this.key = key; @@ -804,33 +307,9 @@ void markColder() { boolean isHot() { return hotCount > 0; } - } - private static final class EvictKey { - private final int keyHash; - private final int packExtPos; - private final long position; - - EvictKey(Ref<?> ref) { - keyHash = ref.key.hash; - packExtPos = ref.key.packExtPos; - position = ref.position; - } - - @Override - public boolean equals(Object object) { - if (object instanceof EvictKey) { - EvictKey other = (EvictKey) object; - return keyHash == other.keyHash - && packExtPos == other.packExtPos - && position == other.position; - } - return false; - } - - @Override - public int hashCode() { - return DfsBlockCache.getInstance().hash(keyHash, position); + int getTotalHitCount() { + return totalHitCount.get(); } }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheTable.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheTable.java new file mode 100644 index 0000000..701d1fd --- /dev/null +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheTable.java
@@ -0,0 +1,340 @@ +/* + * Copyright (c) 2024, Google LLC and others + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Distribution License v. 1.0 which is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +package org.eclipse.jgit.internal.storage.dfs; + +import java.io.IOException; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; + +import org.eclipse.jgit.internal.storage.pack.PackExt; + +/** + * Block cache table. + */ +public interface DfsBlockCacheTable { + /** + * Quickly check if the cache contains block 0 of the given stream. + * <p> + * This can be useful for sophisticated pre-read algorithms to quickly + * determine if a file is likely already in cache, especially small + * reftables which may be smaller than a typical DFS block size. + * + * @param key + * the file to check. + * @return true if block 0 (the first block) is in the cache. + */ + boolean hasBlock0(DfsStreamKey key); + + /** + * Look up a cached object, creating and loading it if it doesn't exist. + * + * @param file + * the pack that "contains" the cached object. + * @param position + * offset within <code>pack</code> of the object. + * @param dfsReader + * current thread's reader. + * @param fileChannel + * supplier for channel to read {@code pack}. + * @return the object reference. + * @throws IOException + * the reference was not in the cache and could not be loaded. + */ + DfsBlock getOrLoad(BlockBasedFile file, long position, DfsReader dfsReader, + DfsBlockCache.ReadableChannelSupplier fileChannel) + throws IOException; + + /** + * Look up a cached object, creating and loading it if it doesn't exist. + * + * @param key + * the stream key of the pack. + * @param position + * the position in the key. The default should be 0. + * @param loader + * the function to load the reference. + * @return the object reference. + * @throws IOException + * the reference was not in the cache and could not be loaded. + */ + <T> DfsBlockCache.Ref<T> getOrLoadRef(DfsStreamKey key, long position, + DfsBlockCache.RefLoader<T> loader) throws IOException; + + /** + * Put a block in the block cache. + * + * @param v + * the block to put in the cache. + */ + void put(DfsBlock v); + + /** + * Put a block in the block cache. + * + * @param key + * the stream key of the pack. + * @param pos + * the position in the key. + * @param size + * the size of the object. + * @param v + * the object to put in the block cache. + * @return the object reference. + */ + <T> DfsBlockCache.Ref<T> put(DfsStreamKey key, long pos, long size, T v); + + /** + * Put an object in the block cache. + * + * @param key + * the stream key of the pack. + * @param size + * the size of the object. + * @param v + * the object to put in the block cache. + * @return the object reference. + */ + <T> DfsBlockCache.Ref<T> putRef(DfsStreamKey key, long size, T v); + + /** + * Check if the block cache contains an object identified by (key, + * position). + * + * @param key + * the stream key of the pack. + * @param position + * the position in the key. + * @return if the block cache contains the object identified by (key, + * position). + */ + boolean contains(DfsStreamKey key, long position); + + /** + * Get the object identified by (key, position) from the block cache. + * + * @param key + * the stream key of the pack. + * @param position + * the position in the key. + * @return the object identified by (key, position). + */ + <T> T get(DfsStreamKey key, long position); + + /** + * Get the DfsBlockCacheStats object for this block cache table's + * statistics. + * + * @return the DfsBlockCacheStats tracking this block cache table's + * statistics. + */ + DfsBlockCacheStats getDfsBlockCacheStats(); + + /** + * Keeps track of stats for a Block Cache table. + */ + class DfsBlockCacheStats { + /** + * Number of times a block was found in the cache, per pack file + * extension. + */ + private final AtomicReference<AtomicLong[]> statHit; + + /** + * Number of times a block was not found, and had to be loaded, per pack + * file extension. + */ + private final AtomicReference<AtomicLong[]> statMiss; + + /** + * Number of blocks evicted due to cache being full, per pack file + * extension. + */ + private final AtomicReference<AtomicLong[]> statEvict; + + /** + * Number of bytes currently loaded in the cache, per pack file + * extension. + */ + private final AtomicReference<AtomicLong[]> liveBytes; + + DfsBlockCacheStats() { + statHit = new AtomicReference<>(newCounters()); + statMiss = new AtomicReference<>(newCounters()); + statEvict = new AtomicReference<>(newCounters()); + liveBytes = new AtomicReference<>(newCounters()); + } + + /** + * Increment the {@code statHit} count. + * + * @param key + * key identifying which liveBytes entry to update. + */ + void incrementHit(DfsStreamKey key) { + getStat(statHit, key).incrementAndGet(); + } + + /** + * Increment the {@code statMiss} count. + * + * @param key + * key identifying which liveBytes entry to update. + */ + void incrementMiss(DfsStreamKey key) { + getStat(statMiss, key).incrementAndGet(); + } + + /** + * Increment the {@code statEvict} count. + * + * @param key + * key identifying which liveBytes entry to update. + */ + void incrementEvict(DfsStreamKey key) { + getStat(statEvict, key).incrementAndGet(); + } + + /** + * Add {@code size} to the {@code liveBytes} count. + * + * @param key + * key identifying which liveBytes entry to update. + * @param size + * amount to increment the count by. + */ + void addToLiveBytes(DfsStreamKey key, long size) { + getStat(liveBytes, key).addAndGet(size); + } + + /** + * Get total number of bytes in the cache, per pack file extension. + * + * @return total number of bytes in the cache, per pack file extension. + */ + long[] getCurrentSize() { + return getStatVals(liveBytes); + } + + /** + * Get number of requests for items in the cache, per pack file + * extension. + * + * @return the number of requests for items in the cache, per pack file + * extension. + */ + long[] getHitCount() { + return getStatVals(statHit); + } + + /** + * Get number of requests for items not in the cache, per pack file + * extension. + * + * @return the number of requests for items not in the cache, per pack + * file extension. + */ + long[] getMissCount() { + return getStatVals(statMiss); + } + + /** + * Get total number of requests (hit + miss), per pack file extension. + * + * @return total number of requests (hit + miss), per pack file + * extension. + */ + long[] getTotalRequestCount() { + AtomicLong[] hit = statHit.get(); + AtomicLong[] miss = statMiss.get(); + long[] cnt = new long[Math.max(hit.length, miss.length)]; + for (int i = 0; i < hit.length; i++) { + cnt[i] += hit[i].get(); + } + for (int i = 0; i < miss.length; i++) { + cnt[i] += miss[i].get(); + } + return cnt; + } + + /** + * Get hit ratios. + * + * @return hit ratios. + */ + long[] getHitRatio() { + AtomicLong[] hit = statHit.get(); + AtomicLong[] miss = statMiss.get(); + long[] ratio = new long[Math.max(hit.length, miss.length)]; + for (int i = 0; i < ratio.length; i++) { + if (i >= hit.length) { + ratio[i] = 0; + } else if (i >= miss.length) { + ratio[i] = 100; + } else { + long hitVal = hit[i].get(); + long missVal = miss[i].get(); + long total = hitVal + missVal; + ratio[i] = total == 0 ? 0 : hitVal * 100 / total; + } + } + return ratio; + } + + /** + * Get number of evictions performed due to cache being full, per pack + * file extension. + * + * @return the number of evictions performed due to cache being full, + * per pack file extension. + */ + long[] getEvictions() { + return getStatVals(statEvict); + } + + private static AtomicLong[] newCounters() { + AtomicLong[] ret = new AtomicLong[PackExt.values().length]; + for (int i = 0; i < ret.length; i++) { + ret[i] = new AtomicLong(); + } + return ret; + } + + private static long[] getStatVals(AtomicReference<AtomicLong[]> stat) { + AtomicLong[] stats = stat.get(); + long[] cnt = new long[stats.length]; + for (int i = 0; i < stats.length; i++) { + cnt[i] = stats[i].get(); + } + return cnt; + } + + private static AtomicLong getStat(AtomicReference<AtomicLong[]> stats, + DfsStreamKey key) { + int pos = key.packExtPos; + while (true) { + AtomicLong[] vals = stats.get(); + if (pos < vals.length) { + return vals[pos]; + } + AtomicLong[] expect = vals; + vals = new AtomicLong[Math.max(pos + 1, + PackExt.values().length)]; + System.arraycopy(expect, 0, vals, 0, expect.length); + for (int i = expect.length; i < vals.length; i++) { + vals[i] = new AtomicLong(); + } + if (stats.compareAndSet(expect, vals)) { + return vals[pos]; + } + } + } + } +} \ No newline at end of file
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java index 62b55d4..a177669 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java
@@ -17,7 +17,6 @@ import static org.eclipse.jgit.internal.storage.dfs.DfsObjDatabase.PackSource.RECEIVE; import static org.eclipse.jgit.internal.storage.dfs.DfsObjDatabase.PackSource.UNREACHABLE_GARBAGE; import static org.eclipse.jgit.internal.storage.dfs.DfsPackCompactor.configureReftable; -import static org.eclipse.jgit.internal.storage.pack.PackExt.BITMAP_INDEX; import static org.eclipse.jgit.internal.storage.pack.PackExt.COMMIT_GRAPH; import static org.eclipse.jgit.internal.storage.pack.PackExt.INDEX; import static org.eclipse.jgit.internal.storage.pack.PackExt.OBJECT_SIZE_INDEX; @@ -709,13 +708,7 @@ private DfsPackDescription writePack(PackSource source, PackWriter pw, } if (pw.prepareBitmapIndex(pm)) { - try (DfsOutputStream out = objdb.writeFile(pack, BITMAP_INDEX)) { - CountingOutputStream cnt = new CountingOutputStream(out); - pw.writeBitmapIndex(cnt); - pack.addFileExt(BITMAP_INDEX); - pack.setFileSize(BITMAP_INDEX, cnt.getCount()); - pack.setBlockSize(BITMAP_INDEX, out.blockSize()); - } + pw.writeBitmapIndex(objdb.getPackBitmapIndexWriter(pack)); } PackStatistics stats = pw.getStatistics();
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java index 9f6eb10..616563f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java
@@ -11,6 +11,7 @@ package org.eclipse.jgit.internal.storage.dfs; import static java.util.stream.Collectors.joining; +import static org.eclipse.jgit.internal.storage.pack.PackExt.BITMAP_INDEX; import java.io.FileNotFoundException; import java.io.IOException; @@ -26,11 +27,14 @@ import java.util.Set; import java.util.concurrent.atomic.AtomicReference; +import org.eclipse.jgit.internal.storage.file.PackBitmapIndexWriterV1; +import org.eclipse.jgit.internal.storage.pack.PackBitmapIndexWriter; import org.eclipse.jgit.internal.storage.pack.PackExt; import org.eclipse.jgit.lib.AnyObjectId; import org.eclipse.jgit.lib.ObjectDatabase; import org.eclipse.jgit.lib.ObjectInserter; import org.eclipse.jgit.lib.ObjectReader; +import org.eclipse.jgit.util.io.CountingOutputStream; /** * Manages objects stored in @@ -743,4 +747,28 @@ public void markDirty() { dirty = true; } } + + /** + * Returns a writer to store the bitmap index in this object database. + * + * @param pack + * Pack file to which the bitmaps are associated. + * @return a writer to store bitmaps associated with the pack + * @throws IOException + * when some I/O problem occurs while creating or writing to + * output stream + */ + public PackBitmapIndexWriter getPackBitmapIndexWriter( + DfsPackDescription pack) throws IOException { + return (bitmaps, packDataChecksum) -> { + try (DfsOutputStream out = writeFile(pack, BITMAP_INDEX)) { + CountingOutputStream cnt = new CountingOutputStream(out); + PackBitmapIndexWriterV1 iw = new PackBitmapIndexWriterV1(cnt); + iw.write(bitmaps, packDataChecksum); + pack.addFileExt(BITMAP_INDEX); + pack.setFileSize(BITMAP_INDEX, cnt.getCount()); + pack.setBlockSize(BITMAP_INDEX, out.blockSize()); + } + }; + } }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java index 42b1d23..5cc2a57 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java
@@ -52,10 +52,12 @@ import org.eclipse.jgit.internal.storage.pack.StoredObjectRepresentation; import org.eclipse.jgit.lib.AbbreviatedObjectId; import org.eclipse.jgit.lib.AnyObjectId; +import org.eclipse.jgit.lib.ConfigConstants; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectLoader; import org.eclipse.jgit.lib.Repository; +import org.eclipse.jgit.lib.StoredConfig; import org.eclipse.jgit.util.LongList; /** @@ -68,7 +70,10 @@ public final class DfsPackFile extends BlockBasedFile { private static final long REF_POSITION = 0; - private static final PackBitmapIndexLoader DEFAULT_BITMAP_LOADER = new StreamPackBitmapIndexLoader(); + /** + * Loader for the default file-based {@link PackBitmapIndex} implementation. + */ + public static final PackBitmapIndexLoader DEFAULT_BITMAP_LOADER = new StreamPackBitmapIndexLoader(); /** Index mapping {@link ObjectId} to position within the pack stream. */ private volatile PackIndex index; @@ -113,7 +118,18 @@ public final class DfsPackFile extends BlockBasedFile { this(cache, desc, DEFAULT_BITMAP_LOADER); } - DfsPackFile(DfsBlockCache cache, DfsPackDescription desc, PackBitmapIndexLoader bitmapLoader) { + /** + * Create an instance of DfsPackFile with a custom bitmap loader + * + * @param cache + * cache that owns the pack data + * @param desc + * description of the pack within the DFS + * @param bitmapLoader + * loader to get the bitmaps of this pack (if any) + */ + public DfsPackFile(DfsBlockCache cache, DfsPackDescription desc, + PackBitmapIndexLoader bitmapLoader) { super(cache, desc, PACK); int bs = desc.getBlockSize(PACK); @@ -1283,11 +1299,16 @@ private DfsBlockCache.Ref<CommitGraph> loadCommitGraph(DfsReader ctx, DfsStreamKey cgkey) throws IOException { ctx.stats.readCommitGraph++; long start = System.nanoTime(); + StoredConfig repoConfig = ctx.db.getRepository().getConfig(); + boolean readChangedPathFilters = repoConfig.getBoolean( + ConfigConstants.CONFIG_COMMIT_GRAPH_SECTION, + ConfigConstants.CONFIG_KEY_READ_CHANGED_PATHS, false); try (ReadableChannel rc = ctx.db.openFile(desc, COMMIT_GRAPH)) { long size; CommitGraph cg; try { - cg = CommitGraphLoader.read(alignTo8kBlocks(rc)); + cg = CommitGraphLoader.read(alignTo8kBlocks(rc), + readChangedPathFilters); } finally { size = rc.position(); ctx.stats.readCommitGraphBytes += size; @@ -1364,12 +1385,22 @@ LoadResult loadPackBitmapIndex(DfsReader ctx, DfsPackFile pack) * The bytes can be 0, if the implementation doesn't do any initial * loading. */ - class LoadResult { - final PackBitmapIndex bitmapIndex; + public class LoadResult { + /** The loaded {@link PackBitmapIndex}. */ + public final PackBitmapIndex bitmapIndex; - final long bytesRead; + /** The bytes read upon initial load (may be 0). */ + public final long bytesRead; - LoadResult(PackBitmapIndex packBitmapIndex, long bytesRead) { + /** + * Constructs the LoadResult. + * + * @param packBitmapIndex + * the loaded index. + * @param bytesRead + * the bytes read upon loading. + */ + public LoadResult(PackBitmapIndex packBitmapIndex, long bytesRead) { this.bitmapIndex = packBitmapIndex; this.bytesRead = bytesRead; }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java index a342796..9cfcbaa 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java
@@ -21,7 +21,6 @@ import java.util.Comparator; import java.util.HashSet; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.Optional; import java.util.Set; @@ -308,7 +307,7 @@ private static class FoundObject<T extends ObjectId> { private <T extends ObjectId> Iterable<FoundObject<T>> findAll( Iterable<T> objectIds) throws IOException { - Collection<T> pending = new LinkedList<>(); + HashSet<T> pending = new HashSet<>(); for (T id : objectIds) { pending.add(id); } @@ -328,22 +327,21 @@ private <T extends ObjectId> Iterable<FoundObject<T>> findAll( } private <T extends ObjectId> void findAllImpl(PackList packList, - Collection<T> pending, List<FoundObject<T>> r) { + HashSet<T> pending, List<FoundObject<T>> r) { DfsPackFile[] packs = packList.packs; if (packs.length == 0) { return; } int lastIdx = 0; DfsPackFile lastPack = packs[lastIdx]; - - OBJECT_SCAN: for (Iterator<T> it = pending.iterator(); it.hasNext();) { - T t = it.next(); + HashSet<T> toRemove = new HashSet<>(); + OBJECT_SCAN: for (T t : pending) { if (!skipGarbagePack(lastPack)) { try { long p = lastPack.findOffset(this, t); if (0 < p) { r.add(new FoundObject<>(t, lastIdx, lastPack, p)); - it.remove(); + toRemove.add(t); continue; } } catch (IOException e) { @@ -361,7 +359,7 @@ private <T extends ObjectId> void findAllImpl(PackList packList, long p = pack.findOffset(this, t); if (0 < p) { r.add(new FoundObject<>(t, i, pack, p)); - it.remove(); + toRemove.add(t); lastIdx = i; lastPack = pack; continue OBJECT_SCAN; @@ -371,6 +369,7 @@ private <T extends ObjectId> void findAllImpl(PackList packList, } } } + pending.removeAll(toRemove); last = lastPack; }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BasePackBitmapIndex.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BasePackBitmapIndex.java index c2b3926..5f979b0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BasePackBitmapIndex.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BasePackBitmapIndex.java
@@ -18,7 +18,7 @@ /** * Base implementation of the PackBitmapIndex. */ -abstract class BasePackBitmapIndex extends PackBitmapIndex { +abstract class BasePackBitmapIndex implements PackBitmapIndex { private final ObjectIdOwnerMap<StoredBitmap> bitmaps; BasePackBitmapIndex(ObjectIdOwnerMap<StoredBitmap> bitmaps) {
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 c88ac98..7f34aed 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
@@ -15,6 +15,7 @@ import java.io.File; import java.io.IOException; +import java.nio.file.FileSystemException; import java.nio.file.NoSuchFileException; import java.nio.file.attribute.BasicFileAttributes; import java.time.Duration; @@ -22,10 +23,12 @@ import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.util.Locale; +import java.util.NoSuchElementException; import java.util.Objects; import java.util.concurrent.TimeUnit; import org.eclipse.jgit.annotations.NonNull; +import org.eclipse.jgit.util.FileUtils; import org.eclipse.jgit.util.FS; import org.eclipse.jgit.util.FS.FileStoreAttributes; import org.slf4j.Logger; @@ -231,14 +234,8 @@ protected FileSnapshot(File file, boolean useConfig) { this.useConfig = useConfig; BasicFileAttributes fileAttributes = null; try { - fileAttributes = FS.DETECTED.fileAttributes(file); - } catch (NoSuchFileException e) { - this.lastModified = Instant.EPOCH; - this.size = 0L; - this.fileKey = MISSING_FILEKEY; - return; - } catch (IOException e) { - LOG.error(e.getMessage(), e); + fileAttributes = getFileAttributes(file); + } catch (NoSuchElementException e) { this.lastModified = Instant.EPOCH; this.size = 0L; this.fileKey = MISSING_FILEKEY; @@ -319,16 +316,11 @@ public boolean isModified(File path) { long currSize; Object currFileKey; try { - BasicFileAttributes fileAttributes = FS.DETECTED.fileAttributes(path); + BasicFileAttributes fileAttributes = getFileAttributes(path); currLastModified = fileAttributes.lastModifiedTime().toInstant(); currSize = fileAttributes.size(); currFileKey = getFileKey(fileAttributes); - } catch (NoSuchFileException e) { - currLastModified = Instant.EPOCH; - currSize = 0L; - currFileKey = MISSING_FILEKEY; - } catch (IOException e) { - LOG.error(e.getMessage(), e); + } catch (NoSuchElementException e) { currLastModified = Instant.EPOCH; currSize = 0L; currFileKey = MISSING_FILEKEY; @@ -586,4 +578,26 @@ private FileStoreAttributes fileStoreAttributeCache() { } return fileStoreAttributeCache; } + + private static BasicFileAttributes getFileAttributes(File path) throws NoSuchElementException { + try { + try { + return FS.DETECTED.fileAttributes(path); + } catch (IOException e) { + if (!FileUtils.isStaleFileHandle(e)) { + throw e; + } + } + } catch (NoSuchFileException e) { + // ignore + } catch (FileSystemException e) { + String msg = e.getMessage(); + if (!msg.endsWith("Not a directory")) { //$NON-NLS-1$ + LOG.error(msg, e); + } + } catch (IOException e) { + LOG.error(e.getMessage(), e); + } + throw new NoSuchElementException(path.toString()); + } }
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 fc058ab..3cc43eb 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
@@ -49,7 +49,6 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Objects; @@ -866,7 +865,7 @@ public Collection<Pack> repack() throws IOException { } } - List<ObjectIdSet> excluded = new LinkedList<>(); + List<ObjectIdSet> excluded = new ArrayList<>(); for (Pack p : repo.getObjectDatabase().getPacks()) { checkCancelled(); if (!shouldPackKeptObjects() && p.shouldBeKept()) { @@ -1399,7 +1398,7 @@ private Pack writePack(@NonNull Set<? extends ObjectId> want, FileChannel idxChannel = fos.getChannel(); OutputStream idxStream = Channels .newOutputStream(idxChannel)) { - pw.writeBitmapIndex(idxStream); + pw.writeBitmapIndex(new PackBitmapIndexWriterV1(idxStream)); idxChannel.force(true); } } @@ -1510,6 +1509,18 @@ public static class RepoStatistics { public long numberOfPackFiles; /** + * The number of pack files that were created after the last bitmap + * generation. + */ + public long numberOfPackFilesSinceBitmap; + + /** + * The number of objects stored in pack files and as loose object + * created after the last bitmap generation. + */ + public long numberOfObjectsSinceBitmap; + + /** * The number of objects stored as loose objects. */ public long numberOfLooseObjects; @@ -1544,6 +1555,10 @@ public String toString() { final StringBuilder b = new StringBuilder(); b.append("numberOfPackedObjects=").append(numberOfPackedObjects); //$NON-NLS-1$ b.append(", numberOfPackFiles=").append(numberOfPackFiles); //$NON-NLS-1$ + b.append(", numberOfPackFilesSinceBitmap=") //$NON-NLS-1$ + .append(numberOfPackFilesSinceBitmap); + b.append(", numberOfObjectsSinceBitmap=") //$NON-NLS-1$ + .append(numberOfObjectsSinceBitmap); b.append(", numberOfLooseObjects=").append(numberOfLooseObjects); //$NON-NLS-1$ b.append(", numberOfLooseRefs=").append(numberOfLooseRefs); //$NON-NLS-1$ b.append(", numberOfPackedRefs=").append(numberOfPackedRefs); //$NON-NLS-1$ @@ -1564,12 +1579,22 @@ public String toString() { public RepoStatistics getStatistics() throws IOException { RepoStatistics ret = new RepoStatistics(); Collection<Pack> packs = repo.getObjectDatabase().getPacks(); + long latestBitmapTime = 0L; for (Pack p : packs) { - ret.numberOfPackedObjects += p.getIndex().getObjectCount(); + long packedObjects = p.getIndex().getObjectCount(); + ret.numberOfPackedObjects += packedObjects; ret.numberOfPackFiles++; ret.sizeOfPackedObjects += p.getPackFile().length(); - if (p.getBitmapIndex() != null) + if (p.getBitmapIndex() != null) { ret.numberOfBitmaps += p.getBitmapIndex().getBitmapCount(); + if (latestBitmapTime == 0L) { + latestBitmapTime = p.getFileSnapshot().lastModifiedInstant().toEpochMilli(); + } + } + else if (latestBitmapTime == 0L) { + ret.numberOfPackFilesSinceBitmap++; + ret.numberOfObjectsSinceBitmap += packedObjects; + } } File objDir = repo.getObjectsDirectory(); String[] fanout = objDir.list(); @@ -1585,6 +1610,9 @@ public RepoStatistics getStatistics() throws IOException { continue; ret.numberOfLooseObjects++; ret.sizeOfLooseObjects += f.length(); + if (f.lastModified() > latestBitmapTime) { + ret.numberOfObjectsSinceBitmap ++; + } } } } @@ -1897,7 +1925,7 @@ private void gcAlreadyRunning() { } private String getProcDesc() { - StringBuffer s = new StringBuffer(Long.toString(getPID())); + StringBuilder s = new StringBuilder(Long.toString(getPID())); s.append(' '); s.append(getHostName()); return s.toString();
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 a2d8bd0..1983541 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
@@ -24,6 +24,7 @@ import java.nio.channels.Channels; import java.nio.channels.FileChannel; import java.nio.file.Files; +import java.nio.file.NoSuchFileException; import java.nio.file.StandardCopyOption; import java.nio.file.attribute.FileTime; import java.text.MessageFormat; @@ -141,9 +142,8 @@ public boolean lock() throws IOException { throw new IllegalStateException( MessageFormat.format(JGitText.get().lockAlreadyHeld, ref)); } - FileUtils.mkdirs(lck.getParentFile(), true); try { - token = FS.DETECTED.createNewFileAtomic(lck); + token = createLockFileWithRetry(); } catch (IOException e) { LOG.error(JGitText.get().failedCreateLockFile, lck, e); throw e; @@ -160,6 +160,19 @@ public boolean lock() throws IOException { return obtainedLock; } + private FS.LockToken createLockFileWithRetry() throws IOException { + try { + return createLockFile(); + } catch (NoSuchFileException e) { + return createLockFile(); + } + } + + private FS.LockToken createLockFile() throws IOException { + FileUtils.mkdirs(lck.getParentFile(), true); + return FS.DETECTED.createNewFileAtomic(lck); + } + /** * Try to establish the lock for appending. *
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java index 9f21481..3a6de4e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java
@@ -200,6 +200,7 @@ public void close() { loose.close(); packed.close(); + preserved.close(); // Fully close all loaded alternates and clear the alternate list. AlternateHandle[] alt = alternates.get();
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/Pack.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/Pack.java index 212dbb2..5813d39 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/Pack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/Pack.java
@@ -95,6 +95,9 @@ public class Pack implements Iterable<PackIndex.MutableEntry> { private RandomAccessFile fd; + /** For managing open/close accounting of {@link #fd}. */ + private final Object activeLock = new Object(); + /** Serializes reads performed against {@link #fd}. */ private final Object readLock = new Object(); @@ -113,13 +116,13 @@ public class Pack implements Iterable<PackIndex.MutableEntry> { private volatile Exception invalidatingCause; @Nullable - private PackFile bitmapIdxFile; + private volatile PackFile bitmapIdxFile; private AtomicInteger transientErrorCount = new AtomicInteger(); private byte[] packChecksum; - private volatile Optionally<PackIndex> loadedIdx = Optionally.empty(); + private Optionally<PackIndex> loadedIdx = Optionally.empty(); private Optionally<PackReverseIndex> reverseIdx = Optionally.empty(); @@ -159,60 +162,54 @@ public Pack(Config cfg, File packFile, @Nullable PackFile bitmapIdxFile) { length = Long.MAX_VALUE; } - private PackIndex idx() throws IOException { + private synchronized PackIndex idx() throws IOException { Optional<PackIndex> optional = loadedIdx.getOptional(); if (optional.isPresent()) { return optional.get(); } - synchronized (this) { - optional = loadedIdx.getOptional(); - if (optional.isPresent()) { - return optional.get(); + if (invalid) { + throw new PackInvalidException(packFile, invalidatingCause); + } + try { + long start = System.currentTimeMillis(); + PackFile idxFile = packFile.create(INDEX); + PackIndex idx = PackIndex.open(idxFile); + if (LOG.isDebugEnabled()) { + LOG.debug(String.format( + "Opening pack index %s, size %.3f MB took %d ms", //$NON-NLS-1$ + idxFile.getAbsolutePath(), + Float.valueOf(idxFile.length() + / (1024f * 1024)), + Long.valueOf(System.currentTimeMillis() + - start))); } - if (invalid) { - throw new PackInvalidException(packFile, invalidatingCause); - } - try { - long start = System.currentTimeMillis(); - PackFile idxFile = packFile.create(INDEX); - PackIndex idx = PackIndex.open(idxFile); - if (LOG.isDebugEnabled()) { - LOG.debug(String.format( - "Opening pack index %s, size %.3f MB took %d ms", //$NON-NLS-1$ - idxFile.getAbsolutePath(), - Float.valueOf(idxFile.length() - / (1024f * 1024)), - Long.valueOf(System.currentTimeMillis() - - start))); - } - if (packChecksum == null) { - packChecksum = idx.packChecksum; - fileSnapshot.setChecksum( - ObjectId.fromRaw(packChecksum)); - } else if (!Arrays.equals(packChecksum, - idx.packChecksum)) { - throw new PackMismatchException(MessageFormat - .format(JGitText.get().packChecksumMismatch, - packFile.getPath(), - PackExt.PACK.getExtension(), - Hex.toHexString(packChecksum), - PackExt.INDEX.getExtension(), - Hex.toHexString(idx.packChecksum))); - } - loadedIdx = optionally(idx); - return idx; - } catch (InterruptedIOException e) { - // don't invalidate the pack, we are interrupted from - // another thread - throw e; - } catch (IOException e) { - invalid = true; - invalidatingCause = e; - throw e; + packChecksum = idx.getChecksum(); + fileSnapshot.setChecksum( + ObjectId.fromRaw(packChecksum)); + } else if (!Arrays.equals(packChecksum, + idx.getChecksum())) { + throw new PackMismatchException(MessageFormat + .format(JGitText.get().packChecksumMismatch, + packFile.getPath(), + PackExt.PACK.getExtension(), + Hex.toHexString(packChecksum), + PackExt.INDEX.getExtension(), + Hex.toHexString(idx.getChecksum()))); } + loadedIdx = optionally(idx); + return idx; + } catch (InterruptedIOException e) { + // don't invalidate the pack, we are interrupted from + // another thread + throw e; + } catch (IOException e) { + invalid = true; + invalidatingCause = e; + throw e; } } + /** * Get the File object which locates this pack on disk. * @@ -296,15 +293,28 @@ void resolve(Set<ObjectId> matches, AbbreviatedObjectId id, int matchLimit) } /** - * Close the resources utilized by this repository + * Close the resources utilized by these pack files + * + * @param packs + * packs to close + */ + public static void close(Set<Pack> packs) { + WindowCache.purge(packs); + packs.forEach(p -> p.closeIndices()); + } + + /** + * Close the resources utilized by this pack file */ public void close() { WindowCache.purge(this); - synchronized (this) { - loadedIdx.clear(); - reverseIdx.clear(); - bitmapIdx.clear(); - } + closeIndices(); + } + + private synchronized void closeIndices() { + loadedIdx.clear(); + reverseIdx.clear(); + bitmapIdx.clear(); } /** @@ -416,185 +426,202 @@ private void copyAsIs2(PackOutputStream out, LocalObjectToPack src, final CRC32 crc2 = validate ? new CRC32() : null; final byte[] buf = out.getCopyBuffer(); + boolean isHeaderWritten = false; // Rip apart the header so we can discover the size. // - readFully(src.offset, buf, 0, 20, curs); - int c = buf[0] & 0xff; - final int typeCode = (c >> 4) & 7; - long inflatedLength = c & 15; - int shift = 4; - int headerCnt = 1; - while ((c & 0x80) != 0) { - c = buf[headerCnt++] & 0xff; - inflatedLength += ((long) (c & 0x7f)) << shift; - shift += 7; - } - - if (typeCode == Constants.OBJ_OFS_DELTA) { - do { - c = buf[headerCnt++] & 0xff; - } while ((c & 128) != 0); - if (validate) { - assert(crc1 != null && crc2 != null); - crc1.update(buf, 0, headerCnt); - crc2.update(buf, 0, headerCnt); - } - } else if (typeCode == Constants.OBJ_REF_DELTA) { - if (validate) { - assert(crc1 != null && crc2 != null); - crc1.update(buf, 0, headerCnt); - crc2.update(buf, 0, headerCnt); - } - - readFully(src.offset + headerCnt, buf, 0, 20, curs); - if (validate) { - assert(crc1 != null && crc2 != null); - crc1.update(buf, 0, 20); - crc2.update(buf, 0, 20); - } - headerCnt += 20; - } else if (validate) { - assert(crc1 != null && crc2 != null); - crc1.update(buf, 0, headerCnt); - crc2.update(buf, 0, headerCnt); - } - - final long dataOffset = src.offset + headerCnt; - final long dataLength = src.length; - final long expectedCRC; - final ByteArrayWindow quickCopy; - - // Verify the object isn't corrupt before sending. If it is, - // we report it missing instead. - // try { - quickCopy = curs.quickCopy(this, dataOffset, dataLength); + readFully(src.offset, buf, 0, 20, curs); - if (validate && idx().hasCRC32Support()) { - assert(crc1 != null); - // Index has the CRC32 code cached, validate the object. - // - expectedCRC = idx().findCRC32(src); - if (quickCopy != null) { - quickCopy.crc32(crc1, dataOffset, (int) dataLength); - } else { - long pos = dataOffset; - long cnt = dataLength; - while (cnt > 0) { - final int n = (int) Math.min(cnt, buf.length); - readFully(pos, buf, 0, n, curs); - crc1.update(buf, 0, n); - pos += n; - cnt -= n; - } - } - if (crc1.getValue() != expectedCRC) { - setCorrupt(src.offset); - throw new CorruptObjectException(MessageFormat.format( - JGitText.get().objectAtHasBadZlibStream, - Long.valueOf(src.offset), getPackFile())); - } - } else if (validate) { - // We don't have a CRC32 code in the index, so compute it - // now while inflating the raw data to get zlib to tell us - // whether or not the data is safe. - // - Inflater inf = curs.inflater(); - byte[] tmp = new byte[1024]; - if (quickCopy != null) { - quickCopy.check(inf, tmp, dataOffset, (int) dataLength); - } else { - assert(crc1 != null); - long pos = dataOffset; - long cnt = dataLength; - while (cnt > 0) { - final int n = (int) Math.min(cnt, buf.length); - readFully(pos, buf, 0, n, curs); - crc1.update(buf, 0, n); - inf.setInput(buf, 0, n); - while (inf.inflate(tmp, 0, tmp.length) > 0) - continue; - pos += n; - cnt -= n; - } - } - if (!inf.finished() || inf.getBytesRead() != dataLength) { - setCorrupt(src.offset); - throw new EOFException(MessageFormat.format( - JGitText.get().shortCompressedStreamAt, - Long.valueOf(src.offset))); - } - assert(crc1 != null); - expectedCRC = crc1.getValue(); - } else { - expectedCRC = -1; + int c = buf[0] & 0xff; + final int typeCode = (c >> 4) & 7; + long inflatedLength = c & 15; + int shift = 4; + int headerCnt = 1; + while ((c & 0x80) != 0) { + c = buf[headerCnt++] & 0xff; + inflatedLength += ((long) (c & 0x7f)) << shift; + shift += 7; } - } catch (DataFormatException dataFormat) { - setCorrupt(src.offset); - CorruptObjectException corruptObject = new CorruptObjectException( - MessageFormat.format( - JGitText.get().objectAtHasBadZlibStream, - Long.valueOf(src.offset), getPackFile()), - dataFormat); + if (typeCode == Constants.OBJ_OFS_DELTA) { + do { + c = buf[headerCnt++] & 0xff; + } while ((c & 128) != 0); + if (validate) { + assert(crc1 != null && crc2 != null); + crc1.update(buf, 0, headerCnt); + crc2.update(buf, 0, headerCnt); + } + } else if (typeCode == Constants.OBJ_REF_DELTA) { + if (validate) { + assert(crc1 != null && crc2 != null); + crc1.update(buf, 0, headerCnt); + crc2.update(buf, 0, headerCnt); + } - throw new StoredObjectRepresentationNotAvailableException( - corruptObject); + readFully(src.offset + headerCnt, buf, 0, 20, curs); + if (validate) { + assert(crc1 != null && crc2 != null); + crc1.update(buf, 0, 20); + crc2.update(buf, 0, 20); + } + headerCnt += 20; + } else if (validate) { + assert(crc1 != null && crc2 != null); + crc1.update(buf, 0, headerCnt); + crc2.update(buf, 0, headerCnt); + } - } catch (IOException ioError) { - throw new StoredObjectRepresentationNotAvailableException(ioError); - } + final long dataOffset = src.offset + headerCnt; + final long dataLength = src.length; + final long expectedCRC; + final ByteArrayWindow quickCopy; - if (quickCopy != null) { - // The entire object fits into a single byte array window slice, - // and we have it pinned. Write this out without copying. + // Verify the object isn't corrupt before sending. If it is, + // we report it missing instead. // - out.writeHeader(src, inflatedLength); - quickCopy.write(out, dataOffset, (int) dataLength); + try { + quickCopy = curs.quickCopy(this, dataOffset, dataLength); - } else if (dataLength <= buf.length) { - // Tiny optimization: Lots of objects are very small deltas or - // deflated commits that are likely to fit in the copy buffer. - // - if (!validate) { + if (validate && idx().hasCRC32Support()) { + assert(crc1 != null); + // Index has the CRC32 code cached, validate the object. + // + expectedCRC = idx().findCRC32(src); + if (quickCopy != null) { + quickCopy.crc32(crc1, dataOffset, (int) dataLength); + } else { + long pos = dataOffset; + long cnt = dataLength; + while (cnt > 0) { + final int n = (int) Math.min(cnt, buf.length); + readFully(pos, buf, 0, n, curs); + crc1.update(buf, 0, n); + pos += n; + cnt -= n; + } + } + if (crc1.getValue() != expectedCRC) { + setCorrupt(src.offset); + throw new CorruptObjectException(MessageFormat.format( + JGitText.get().objectAtHasBadZlibStream, + Long.valueOf(src.offset), getPackFile())); + } + } else if (validate) { + // We don't have a CRC32 code in the index, so compute it + // now while inflating the raw data to get zlib to tell us + // whether or not the data is safe. + // + Inflater inf = curs.inflater(); + byte[] tmp = new byte[1024]; + if (quickCopy != null) { + quickCopy.check(inf, tmp, dataOffset, (int) dataLength); + } else { + assert(crc1 != null); + long pos = dataOffset; + long cnt = dataLength; + while (cnt > 0) { + final int n = (int) Math.min(cnt, buf.length); + readFully(pos, buf, 0, n, curs); + crc1.update(buf, 0, n); + inf.setInput(buf, 0, n); + while (inf.inflate(tmp, 0, tmp.length) > 0) + continue; + pos += n; + cnt -= n; + } + } + if (!inf.finished() || inf.getBytesRead() != dataLength) { + setCorrupt(src.offset); + throw new EOFException(MessageFormat.format( + JGitText.get().shortCompressedStreamAt, + Long.valueOf(src.offset))); + } + assert(crc1 != null); + expectedCRC = crc1.getValue(); + } else { + expectedCRC = -1; + } + } catch (DataFormatException dataFormat) { + setCorrupt(src.offset); + + CorruptObjectException corruptObject = new CorruptObjectException( + MessageFormat.format( + JGitText.get().objectAtHasBadZlibStream, + Long.valueOf(src.offset), getPackFile()), + dataFormat); + + throw new StoredObjectRepresentationNotAvailableException( + corruptObject); + } + + if (quickCopy != null) { + // The entire object fits into a single byte array window slice, + // and we have it pinned. Write this out without copying. + // + out.writeHeader(src, inflatedLength); + isHeaderWritten = true; + quickCopy.write(out, dataOffset, (int) dataLength); + + } else if (dataLength <= buf.length) { + // Tiny optimization: Lots of objects are very small deltas or + // deflated commits that are likely to fit in the copy buffer. + // + if (!validate) { + long pos = dataOffset; + long cnt = dataLength; + while (cnt > 0) { + final int n = (int) Math.min(cnt, buf.length); + readFully(pos, buf, 0, n, curs); + pos += n; + cnt -= n; + } + } + out.writeHeader(src, inflatedLength); + isHeaderWritten = true; + out.write(buf, 0, (int) dataLength); + } else { + // Now we are committed to sending the object. As we spool it out, + // check its CRC32 code to make sure there wasn't corruption between + // the verification we did above, and us actually outputting it. + // long pos = dataOffset; long cnt = dataLength; while (cnt > 0) { final int n = (int) Math.min(cnt, buf.length); readFully(pos, buf, 0, n, curs); - pos += n; + if (validate) { + assert(crc2 != null); + crc2.update(buf, 0, n); + } cnt -= n; + if (!isHeaderWritten) { + if (invalid && cnt > 0) { + // Since this is not the last iteration and the packfile is invalid, + // better to assume the iterations will not all complete here while + // it is still likely recoverable. + throw new StoredObjectRepresentationNotAvailableException(invalidatingCause); + } + out.writeHeader(src, inflatedLength); + isHeaderWritten = true; + } + out.write(buf, 0, n); + pos += n; } - } - out.writeHeader(src, inflatedLength); - out.write(buf, 0, (int) dataLength); - } else { - // Now we are committed to sending the object. As we spool it out, - // check its CRC32 code to make sure there wasn't corruption between - // the verification we did above, and us actually outputting it. - // - out.writeHeader(src, inflatedLength); - long pos = dataOffset; - long cnt = dataLength; - while (cnt > 0) { - final int n = (int) Math.min(cnt, buf.length); - readFully(pos, buf, 0, n, curs); if (validate) { assert(crc2 != null); - crc2.update(buf, 0, n); - } - out.write(buf, 0, n); - pos += n; - cnt -= n; - } - if (validate) { - assert(crc2 != null); - if (crc2.getValue() != expectedCRC) { - throw new CorruptObjectException(MessageFormat.format( - JGitText.get().objectAtHasBadZlibStream, - Long.valueOf(src.offset), getPackFile())); + if (crc2.getValue() != expectedCRC) { + throw new CorruptObjectException(MessageFormat.format( + JGitText.get().objectAtHasBadZlibStream, + Long.valueOf(src.offset), getPackFile())); + } } } + } catch (IOException ioError) { + if (!isHeaderWritten) { + throw new StoredObjectRepresentationNotAvailableException(ioError); + } + throw ioError; } } @@ -621,42 +648,53 @@ private void readFully(final long position, final byte[] dstbuf, throw new EOFException(); } - private synchronized void beginCopyAsIs() + private void beginCopyAsIs() throws StoredObjectRepresentationNotAvailableException { - if (++activeCopyRawData == 1 && activeWindows == 0) { - try { - doOpen(); - } catch (IOException thisPackNotValid) { - throw new StoredObjectRepresentationNotAvailableException( - thisPackNotValid); + synchronized (activeLock) { + if (++activeCopyRawData == 1 && activeWindows == 0) { + try { + doOpen(); + } catch (IOException thisPackNotValid) { + throw new StoredObjectRepresentationNotAvailableException( + thisPackNotValid); + } } } } - private synchronized void endCopyAsIs() { - if (--activeCopyRawData == 0 && activeWindows == 0) - doClose(); - } - - synchronized boolean beginWindowCache() throws IOException { - if (++activeWindows == 1) { - if (activeCopyRawData == 0) - doOpen(); - return true; + private void endCopyAsIs() { + synchronized (activeLock) { + if (--activeCopyRawData == 0 && activeWindows == 0) { + doClose(); + } } - return false; } - synchronized boolean endWindowCache() { - final boolean r = --activeWindows == 0; - if (r && activeCopyRawData == 0) - doClose(); - return r; + boolean beginWindowCache() throws IOException { + synchronized (activeLock) { + if (++activeWindows == 1) { + if (activeCopyRawData == 0) { + doOpen(); + } + return true; + } + return false; + } + } + + boolean endWindowCache() { + synchronized (activeLock) { + boolean r = --activeWindows == 0; + if (r && activeCopyRawData == 0) { + doClose(); + } + return r; + } } private void doOpen() throws IOException { if (invalid) { - openFail(true, invalidatingCause); + openFail(invalidatingCause); throw new PackInvalidException(packFile, invalidatingCause); } try { @@ -667,39 +705,41 @@ private void doOpen() throws IOException { } } catch (InterruptedIOException e) { // don't invalidate the pack, we are interrupted from another thread - openFail(false, e); + openFail(e); throw e; } catch (FileNotFoundException fn) { - // don't invalidate the pack if opening an existing file failed - // since it may be related to a temporary lack of resources (e.g. - // max open files) - openFail(!packFile.exists(), fn); + if (!packFile.exists()) { + // Failure to open an existing file may be related to a temporary lack of resources + // (e.g. max open files) + invalid = true; + } + openFail(fn); throw fn; } catch (EOFException | AccessDeniedException | NoSuchFileException | CorruptObjectException | NoPackSignatureException | PackMismatchException | UnpackException | UnsupportedPackIndexVersionException | UnsupportedPackVersionException pe) { - // exceptions signaling permanent problems with a pack - openFail(true, pe); + invalid = true; // exceptions signaling permanent problems with a pack + openFail(pe); throw pe; } catch (IOException ioe) { - // mark this packfile as invalid when NFS stale file handle error - // occur - openFail(FileUtils.isStaleFileHandleInCausalChain(ioe), ioe); + if (FileUtils.isStaleFileHandleInCausalChain(ioe)) { + invalid = true; + } + openFail(ioe); throw ioe; } catch (RuntimeException ge) { // generic exceptions could be transient so we should not mark the // pack invalid to avoid false MissingObjectExceptions - openFail(false, ge); + openFail(ge); throw ge; } } - private void openFail(boolean invalidate, Exception cause) { + private void openFail(Exception cause) { activeWindows = 0; activeCopyRawData = 0; - invalid = invalidate; invalidatingCause = cause; doClose(); } @@ -791,7 +831,7 @@ private void onOpenPack() throws IOException { MessageFormat.format(JGitText.get().packChecksumMismatch, getPackFile(), PackExt.PACK.getExtension(), Hex.toHexString(buf), PackExt.INDEX.getExtension(), - Hex.toHexString(idx.packChecksum))); + Hex.toHexString(idx.getChecksum()))); } } @@ -1154,7 +1194,7 @@ synchronized PackBitmapIndex getBitmapIndex() throws IOException { PackBitmapIndex idx = PackBitmapIndex.open(bitmapIdxFile, idx(), getReverseIdx()); // At this point, idx() will have set packChecksum. - if (Arrays.equals(packChecksum, idx.packChecksum)) { + if (Arrays.equals(packChecksum, idx.getPackChecksum())) { bitmapIdx = optionally(idx); return idx; } @@ -1173,17 +1213,8 @@ synchronized PackBitmapIndex getBitmapIndex() throws IOException { return null; } - synchronized void refreshBitmapIndex(PackFile bitmapIndexFile) { - this.bitmapIdx = Optionally.empty(); - this.invalid = false; + void setBitmapIndexFile(PackFile bitmapIndexFile) { this.bitmapIdxFile = bitmapIndexFile; - try { - getBitmapIndex(); - } catch (IOException e) { - LOG.warn(JGitText.get().bitmapFailedToGet, bitmapIdxFile, e); - this.bitmapIdx = Optionally.empty(); - this.bitmapIdxFile = null; - } } private synchronized PackReverseIndex getReverseIdx() throws IOException {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndex.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndex.java index def4f3d..cbda8fc 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndex.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndex.java
@@ -35,7 +35,7 @@ * {@link #findPosition(AnyObjectId)} can be used to build other bitmaps that a * compatible with the encoded bitmaps available from the index. */ -public abstract class PackBitmapIndex { +public interface PackBitmapIndex { /** Flag bit denoting the bitmap should be reused during index creation. */ public static final int FLAG_REUSE = 1; @@ -132,8 +132,14 @@ public static PackBitmapIndex read(InputStream fd, reverseIndexSupplier, loadParallelRevIndex); } - /** Footer checksum applied on the bottom of the pack file. */ - byte[] packChecksum; + /** + * Footer checksum applied on the bottom of the pack file. + * + * @return checksum as a byte array + */ + default byte[] getPackChecksum() { + return null; + } /** * Finds the position in the bitmap of the object. @@ -148,7 +154,9 @@ public static PackBitmapIndex read(InputStream fd, * Get the object at the bitmap position. * * @param position - * the id for which the object will be found. + * the offset in the bitmap which corresponds to an object of + * interest. This position is the same as the order of the object + * in the {@link PackFile}. * @return the ObjectId. * @throws java.lang.IllegalArgumentException * when the item is not found.
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java index a47f2df..08d2b71 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java
@@ -11,9 +11,9 @@ package org.eclipse.jgit.internal.storage.file; import java.text.MessageFormat; +import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Collections; -import java.util.LinkedList; import java.util.List; import org.eclipse.jgit.internal.JGitText; @@ -41,8 +41,7 @@ public class PackBitmapIndexBuilder extends BasePackBitmapIndex { private final EWAHCompressedBitmap tags; private final BlockList<PositionEntry> byOffset; - private final LinkedList<StoredBitmap> - bitmapsToWriteXorBuffer = new LinkedList<>(); + private final ArrayDeque<StoredBitmap> bitmapsToWriteXorBuffer = new ArrayDeque<>(); private List<StoredEntry> bitmapsToWrite = new ArrayList<>(); @@ -106,7 +105,7 @@ private static void sortByOffsetAndIndex(BlockList<PositionEntry> byOffset, .signum(a.getOffset() - b.getOffset())); for (int i = 0; i < entries.size(); i++) { PositionEntry e = positionEntries.get(entries.get(i)); - e.offsetPosition = i; + e.ridxPosition = i; byOffset.add(e); } } @@ -191,8 +190,8 @@ private StoredEntry generateStoredEntry(StoredBitmap bitmapToWrite) { throw new IllegalStateException(); } bestBitmap.trim(); - StoredEntry result = new StoredEntry(entry.namePosition, bestBitmap, - bestXorOffset, bitmapToWrite.getFlags()); + StoredEntry result = new StoredEntry(entry, entry.idxPosition, + bestBitmap, bestXorOffset, bitmapToWrite.getFlags()); return result; } @@ -235,7 +234,7 @@ public int findPosition(AnyObjectId objectId) { PositionEntry entry = positionEntries.get(objectId); if (entry == null) return -1; - return entry.offsetPosition; + return entry.ridxPosition; } @Override @@ -323,20 +322,44 @@ public List<StoredEntry> getCompressedBitmaps() { generateStoredEntry(bitmapsToWriteXorBuffer.pollFirst())); } - Collections.reverse(bitmapsToWrite); - return bitmapsToWrite; + List<StoredEntry> bitmapsToReturn = new ArrayList<>(bitmapsToWrite); + Collections.reverse(bitmapsToReturn); + return bitmapsToReturn; } /** Data object for the on disk representation of a bitmap entry. */ public static final class StoredEntry { - private final long objectId; + private final ObjectId objectId; + + private final long idxPosition; + private final EWAHCompressedBitmap bitmap; + private final int xorOffset; + private final int flags; - StoredEntry(long objectId, EWAHCompressedBitmap bitmap, - int xorOffset, int flags) { + /** + * Create a StoredEntry + * + * @param objectId + * objectId of the object associated with the bitmap + * @param idxPosition + * position of this object into the pack index (i.e. sorted + * by sha1) + * @param bitmap + * bitmap associated with this object + * @param xorOffset + * offset of the bitmap against which this bitmap is + * xor-compressed. If 0, then this bitmap is not + * xor-compressed against any other bitmap + * @param flags + * flags for this bitmap + */ + public StoredEntry(ObjectId objectId, long idxPosition, + EWAHCompressedBitmap bitmap, int xorOffset, int flags) { this.objectId = objectId; + this.idxPosition = idxPosition; this.bitmap = bitmap; this.xorOffset = xorOffset; this.flags = flags; @@ -370,23 +393,29 @@ public int getFlags() { } /** - * Get the ObjectId - * - * @return the ObjectId + * @return the position of the object with this bitmap in the primary + * index (i.e. ordered by sha1) */ - public long getObjectId() { + public long getIdxPosition() { + return idxPosition; + } + + /** + * @return the objectId of the object associated with this bitmap + */ + public ObjectId getObjectId() { return objectId; } } private static final class PositionEntry extends ObjectIdOwnerMap.Entry { - final int namePosition; + final int idxPosition; - int offsetPosition; + int ridxPosition; - PositionEntry(AnyObjectId objectId, int namePosition) { + PositionEntry(AnyObjectId objectId, int idxPosition) { super(objectId); - this.namePosition = namePosition; + this.idxPosition = idxPosition; } } }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java index bb7cfd0..ffbc073 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java
@@ -28,8 +28,8 @@ * implementations this implementation is not thread safe, as it is intended to * be used with a PackBitmapIndexBuilder, which is also not thread safe. */ -public class PackBitmapIndexRemapper extends PackBitmapIndex - implements Iterable<PackBitmapIndexRemapper.Entry> { +public class PackBitmapIndexRemapper + implements PackBitmapIndex, Iterable<PackBitmapIndexRemapper.Entry> { private final BasePackBitmapIndex oldPackIndex; final PackBitmapIndex newPackIndex;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexV1.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexV1.java index f2f24b3..19608c1 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexV1.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexV1.java
@@ -46,6 +46,8 @@ class PackBitmapIndexV1 extends BasePackBitmapIndex { private static final int MAX_XOR_OFFSET = 126; + private byte[] packChecksum; + private static final ExecutorService executor = Executors .newCachedThreadPool(new ThreadFactory() { private final ThreadFactory baseFactory = Executors @@ -269,6 +271,11 @@ public int hashCode() { return getPackIndex().hashCode(); } + @Override + public byte[] getPackChecksum() { + return this.packChecksum; + } + PackIndex getPackIndex() { return packIndex; }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexWriterV1.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexWriterV1.java index a5c8423..38d7c90 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexWriterV1.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexWriterV1.java
@@ -19,6 +19,7 @@ import org.eclipse.jgit.internal.JGitText; import org.eclipse.jgit.internal.storage.file.PackBitmapIndexBuilder.StoredEntry; +import org.eclipse.jgit.internal.storage.pack.PackBitmapIndexWriter; import org.eclipse.jgit.lib.Constants; import com.googlecode.javaewah.EWAHCompressedBitmap; @@ -28,7 +29,7 @@ * * @see PackBitmapIndexV1 */ -public class PackBitmapIndexWriterV1 { +public class PackBitmapIndexWriterV1 implements PackBitmapIndexWriter { private final DigestOutputStream out; private final DataOutput dataOutput; @@ -60,6 +61,7 @@ public PackBitmapIndexWriterV1(final OutputStream dst) { * an error occurred while writing to the output stream, or this * index format cannot store the object data supplied. */ + @Override public void write(PackBitmapIndexBuilder bitmaps, byte[] packDataChecksum) throws IOException { if (bitmaps == null || packDataChecksum.length != 20) @@ -113,7 +115,7 @@ private void writeBitmaps(PackBitmapIndexBuilder bitmaps) private void writeBitmapEntry(StoredEntry entry) throws IOException { // Write object, XOR offset, and bitmap - dataOutput.writeInt((int) entry.getObjectId()); + dataOutput.writeInt((int) entry.getIdxPosition()); out.write(entry.getXorOffset()); out.write(entry.getFlags()); writeBitmap(entry.getBitmap());
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackDirectory.java index 8221cff..5cc7be4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackDirectory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackDirectory.java
@@ -24,6 +24,7 @@ import java.util.Collections; import java.util.EnumMap; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -111,9 +112,7 @@ void create() throws IOException { void close() { PackList packs = packList.get(); if (packs != NO_PACKS && packList.compareAndSet(packs, NO_PACKS)) { - for (Pack p : packs.packs) { - p.close(); - } + Pack.close(Set.of(packs.packs)); } } @@ -460,12 +459,9 @@ private PackList scanPacksImpl(PackList old) { && !oldPack.getFileSnapshot().isModified(packFile)) { forReuse.remove(packFile.getName()); list.add(oldPack); - try { - if(oldPack.getBitmapIndex() == null) { - oldPack.refreshBitmapIndex(packFilesByExt.get(BITMAP_INDEX)); - } - } catch (IOException e) { - LOG.warn(JGitText.get().bitmapAccessErrorForPackfile, oldPack.getPackName(), e); + PackFile bitMaps = packFilesByExt.get(BITMAP_INDEX); + if (bitMaps != null) { + oldPack.setBitmapIndexFile(bitMaps); } continue; } @@ -484,9 +480,7 @@ private PackList scanPacksImpl(PackList old) { return old; } - for (Pack p : forReuse.values()) { - p.close(); - } + Pack.close(new HashSet<>(forReuse.values())); if (list.isEmpty()) { return new PackList(snapshot, NO_PACKS.packs); @@ -545,7 +539,7 @@ private Map<String, Map<PackExt, PackFile>> getPackFilesByExtById() { for (String name : nameList) { try { PackFile pack = new PackFile(directory, name); - if (pack.getPackExt() != null) { + if (pack.getPackExt() != null && !pack.isTmpGCFile()) { Map<PackExt, PackFile> packByExt = packFilesByExtById .get(pack.getId()); if (packByExt == null) {
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 19979d0..c9b05ad 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
@@ -27,6 +27,7 @@ public class PackFile extends File { private static final long serialVersionUID = 1L; private static final String PREFIX = "pack-"; //$NON-NLS-1$ + private static final String TMP_GC_PREFIX = ".tmp-"; //$NON-NLS-1$ private final String base; // PREFIX + id i.e. // pack-0123456789012345678901234567890123456789 @@ -126,6 +127,13 @@ public PackExt getPackExt() { } /** + * @return whether the file is a temporary GC file + */ + public boolean isTmpGCFile() { + return id.startsWith(TMP_GC_PREFIX); + } + + /** * Create a new similar PackFile with the given extension instead. * * @param ext
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndex.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndex.java index c42d1c8..c0540d5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndex.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndex.java
@@ -42,8 +42,8 @@ * by ObjectId. * </p> */ -public abstract class PackIndex - implements Iterable<PackIndex.MutableEntry>, ObjectIdSet { +public interface PackIndex + extends Iterable<PackIndex.MutableEntry>, ObjectIdSet { /** * Open an existing pack <code>.idx</code> file for reading. * <p> @@ -61,7 +61,7 @@ public abstract class PackIndex * the file exists but could not be read due to security errors, * unrecognized data version, or unexpected data corruption. */ - public static PackIndex open(File idxFile) throws IOException { + static PackIndex open(File idxFile) throws IOException { try (SilentFileInputStream fd = new SilentFileInputStream( idxFile)) { return read(fd); @@ -92,7 +92,7 @@ public static PackIndex open(File idxFile) throws IOException { * @throws org.eclipse.jgit.errors.CorruptObjectException * the stream does not contain a valid pack index. */ - public static PackIndex read(InputStream fd) throws IOException, + static PackIndex read(InputStream fd) throws IOException, CorruptObjectException { final byte[] hdr = new byte[8]; IO.readFully(fd, hdr, 0, hdr.length); @@ -116,9 +116,6 @@ private static boolean isTOC(byte[] h) { return true; } - /** Footer checksum applied on the bottom of the pack file. */ - protected byte[] packChecksum; - /** * Determine if an object is contained within the pack file. * @@ -126,12 +123,12 @@ private static boolean isTOC(byte[] h) { * the object to look for. Must not be null. * @return true if the object is listed in this index; false otherwise. */ - public boolean hasObject(AnyObjectId id) { + default boolean hasObject(AnyObjectId id) { return findOffset(id) != -1; } @Override - public boolean contains(AnyObjectId id) { + default boolean contains(AnyObjectId id) { return findOffset(id) != -1; } @@ -147,7 +144,7 @@ public boolean contains(AnyObjectId id) { * </p> */ @Override - public abstract Iterator<MutableEntry> iterator(); + Iterator<MutableEntry> iterator(); /** * Obtain the total number of objects described by this index. @@ -155,7 +152,7 @@ public boolean contains(AnyObjectId id) { * @return number of objects in this index, and likewise in the associated * pack that this index was generated from. */ - public abstract long getObjectCount(); + long getObjectCount(); /** * Obtain the total number of objects needing 64 bit offsets. @@ -163,7 +160,7 @@ public boolean contains(AnyObjectId id) { * @return number of objects in this index using a 64 bit offset; that is an * object positioned after the 2 GB position within the file. */ - public abstract long getOffset64Count(); + long getOffset64Count(); /** * Get ObjectId for the n-th object entry returned by {@link #iterator()}. @@ -185,7 +182,7 @@ public boolean contains(AnyObjectId id) { * is 0, the second is 1, etc. * @return the ObjectId for the corresponding entry. */ - public abstract ObjectId getObjectId(long nthPosition); + ObjectId getObjectId(long nthPosition); /** * Get ObjectId for the n-th object entry returned by {@link #iterator()}. @@ -209,7 +206,7 @@ public boolean contains(AnyObjectId id) { * negative, but still valid. * @return the ObjectId for the corresponding entry. */ - public final ObjectId getObjectId(int nthPosition) { + default ObjectId getObjectId(int nthPosition) { if (nthPosition >= 0) return getObjectId((long) nthPosition); final int u31 = nthPosition >>> 1; @@ -228,7 +225,7 @@ public final ObjectId getObjectId(int nthPosition) { * etc. Positions past 2**31-1 are negative, but still valid. * @return the offset in a pack for the corresponding entry. */ - abstract long getOffset(long nthPosition); + long getOffset(long nthPosition); /** * Locate the file offset position for the requested object. @@ -239,7 +236,7 @@ public final ObjectId getObjectId(int nthPosition) { * object does not exist in this index and is thus not stored in the * associated pack. */ - public abstract long findOffset(AnyObjectId objId); + long findOffset(AnyObjectId objId); /** * Locate the position of this id in the list of object-ids in the index @@ -250,7 +247,7 @@ public final ObjectId getObjectId(int nthPosition) { * of ids stored in this index; -1 if the object does not exist in * this index and is thus not stored in the associated pack. */ - public abstract int findPosition(AnyObjectId objId); + int findPosition(AnyObjectId objId); /** * Retrieve stored CRC32 checksum of the requested object raw-data @@ -264,7 +261,7 @@ public final ObjectId getObjectId(int nthPosition) { * @throws java.lang.UnsupportedOperationException * when this index doesn't support CRC32 checksum */ - public abstract long findCRC32(AnyObjectId objId) + long findCRC32(AnyObjectId objId) throws MissingObjectException, UnsupportedOperationException; /** @@ -272,7 +269,7 @@ public abstract long findCRC32(AnyObjectId objId) * * @return true if CRC32 is stored, false otherwise */ - public abstract boolean hasCRC32Support(); + boolean hasCRC32Support(); /** * Find objects matching the prefix abbreviation. @@ -288,7 +285,7 @@ public abstract long findCRC32(AnyObjectId objId) * @throws java.io.IOException * the index cannot be read. */ - public abstract void resolve(Set<ObjectId> matches, AbbreviatedObjectId id, + void resolve(Set<ObjectId> matches, AbbreviatedObjectId id, int matchLimit) throws IOException; /** @@ -297,16 +294,14 @@ public abstract void resolve(Set<ObjectId> matches, AbbreviatedObjectId id, * @return the checksum of the pack; caller must not modify it * @since 5.5 */ - public byte[] getChecksum() { - return packChecksum; - } + byte[] getChecksum(); /** * Represent mutable entry of pack index consisting of object id and offset * in pack (both mutable). * */ - public static class MutableEntry { + class MutableEntry { final MutableObjectId idBuffer = new MutableObjectId(); long offset; @@ -358,16 +353,25 @@ void ensureId() { } } + /** + * Base implementation of the iterator over index entries. + */ abstract class EntriesIterator implements Iterator<MutableEntry> { protected final MutableEntry entry = initEntry(); + private final long objectCount; + + protected EntriesIterator(long objectCount) { + this.objectCount = objectCount; + } + protected long returnedNumber = 0; protected abstract MutableEntry initEntry(); @Override public boolean hasNext() { - return returnedNumber < getObjectCount(); + return returnedNumber < objectCount; } /**
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV1.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV1.java index 4563c90..d7c8378 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV1.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV1.java
@@ -29,13 +29,16 @@ import org.eclipse.jgit.util.IO; import org.eclipse.jgit.util.NB; -class PackIndexV1 extends PackIndex { +class PackIndexV1 implements PackIndex { private static final int IDX_HDR_LEN = 256 * 4; private static final int RECORD_SIZE = 4 + Constants.OBJECT_ID_LENGTH; private final long[] idxHeader; + /** Footer checksum applied on the bottom of the pack file. */ + protected byte[] packChecksum; + byte[][] idxdata; private long objectCnt; @@ -118,7 +121,7 @@ public ObjectId getObjectId(long nthPosition) { } @Override - long getOffset(long nthPosition) { + public long getOffset(long nthPosition) { final int levelOne = findLevelOne(nthPosition); final int levelTwo = getLevelTwo(nthPosition, levelOne); final int p = (4 + Constants.OBJECT_ID_LENGTH) * levelTwo; @@ -200,7 +203,7 @@ public boolean hasCRC32Support() { @Override public Iterator<MutableEntry> iterator() { - return new IndexV1Iterator(); + return new IndexV1Iterator(objectCnt); } @Override @@ -238,11 +241,20 @@ private static int idOffset(int mid) { return (RECORD_SIZE * mid) + 4; } + @Override + public byte[] getChecksum() { + return packChecksum; + } + private class IndexV1Iterator extends EntriesIterator { int levelOne; int levelTwo; + IndexV1Iterator(long objectCount) { + super(objectCount); + } + @Override protected MutableEntry initEntry() { return new MutableEntry() {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV2.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV2.java index 751b62d..caf8b71 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV2.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV2.java
@@ -28,7 +28,7 @@ import org.eclipse.jgit.util.NB; /** Support for the pack index v2 format. */ -class PackIndexV2 extends PackIndex { +class PackIndexV2 implements PackIndex { private static final long IS_O64 = 1L << 31; private static final int FANOUT = 256; @@ -37,6 +37,9 @@ class PackIndexV2 extends PackIndex { private static final byte[] NO_BYTES = {}; + /** Footer checksum applied on the bottom of the pack file. */ + protected byte[] packChecksum; + private long objectCnt; private final long[] fanoutTable; @@ -221,7 +224,7 @@ public boolean hasCRC32Support() { @Override public Iterator<MutableEntry> iterator() { - return new EntriesIteratorV2(); + return new EntriesIteratorV2(objectCnt); } @Override @@ -281,11 +284,20 @@ else if (cmp == 0) { return -1; } + @Override + public byte[] getChecksum() { + return packChecksum; + } + private class EntriesIteratorV2 extends EntriesIterator { int levelOne; int levelTwo; + EntriesIteratorV2(long objectCount){ + super(objectCount); + } + @Override protected MutableEntry initEntry() { return new MutableEntry() {
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 169dce1..321584b 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
@@ -41,11 +41,11 @@ import java.security.DigestInputStream; import java.security.MessageDigest; import java.text.MessageFormat; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; @@ -64,8 +64,8 @@ import org.eclipse.jgit.internal.JGitText; import org.eclipse.jgit.lib.ConfigConstants; import org.eclipse.jgit.lib.Constants; -import org.eclipse.jgit.lib.CoreConfig.TrustPackedRefsStat; import org.eclipse.jgit.lib.CoreConfig.TrustLooseRefStat; +import org.eclipse.jgit.lib.CoreConfig.TrustPackedRefsStat; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectIdRef; import org.eclipse.jgit.lib.Ref; @@ -413,7 +413,7 @@ public List<Ref> getRefsByPrefix(String... prefixes) throws IOException { @Override public List<Ref> getAdditionalRefs() throws IOException { - List<Ref> ret = new LinkedList<>(); + List<Ref> ret = new ArrayList<>(); for (String name : additionalRefsNames) { Ref r = exactRef(name); if (r != null) @@ -678,41 +678,47 @@ void delete(RefDirectoryUpdate update) throws IOException { } String name = dst.getName(); - // Write the packed-refs file using an atomic update. We might - // wind up reading it twice, before and after the lock, to ensure - // we don't miss an edit made externally. - PackedRefList packed = getPackedRefs(); - if (packed.contains(name)) { - inProcessPackedRefsLock.lock(); + // Get and keep the packed-refs lock while updating packed-refs and + // removing any loose ref + inProcessPackedRefsLock.lock(); + try { + LockFile lck = lockPackedRefsOrThrow(); try { - LockFile lck = lockPackedRefsOrThrow(); - try { + // Write the packed-refs file using an atomic update. We might + // wind up reading it twice, before and after checking if the + // ref to delete is included or not, to ensure + // we don't rely on a PackedRefList that is a result of in-memory + // or NFS caching. + PackedRefList packed = getPackedRefs(); + if (packed.contains(name)) { + // Force update our packed-refs snapshot before writing packed = refreshPackedRefs(); int idx = packed.find(name); if (0 <= idx) { commitPackedRefs(lck, packed.remove(idx), packed, true); } - } finally { - lck.unlock(); + } + + RefList<LooseRef> curLoose, newLoose; + do { + curLoose = looseRefs.get(); + int idx = curLoose.find(name); + if (idx < 0) { + break; + } + newLoose = curLoose.remove(idx); + } while (!looseRefs.compareAndSet(curLoose, newLoose)); + + int levels = levelsIn(name) - 2; + delete(logFor(name), levels); + if (dst.getStorage().isLoose()) { + deleteAndUnlock(fileFor(name), levels, update); } } finally { - inProcessPackedRefsLock.unlock(); + lck.unlock(); } - } - - RefList<LooseRef> curLoose, newLoose; - do { - curLoose = looseRefs.get(); - int idx = curLoose.find(name); - if (idx < 0) - break; - newLoose = curLoose.remove(idx); - } while (!looseRefs.compareAndSet(curLoose, newLoose)); - - int levels = levelsIn(name) - 2; - delete(logFor(name), levels); - if (dst.getStorage().isLoose()) { - deleteAndUnlock(fileFor(name), levels, update); + } finally { + inProcessPackedRefsLock.unlock(); } modCnt.incrementAndGet();
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/SnapshottingRefDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/SnapshottingRefDirectory.java index 46607f6..1dc5776 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/SnapshottingRefDirectory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/SnapshottingRefDirectory.java
@@ -16,15 +16,21 @@ import org.eclipse.jgit.lib.RefUpdate; import org.eclipse.jgit.revwalk.RevWalk; +import java.io.File; import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.List; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; /** * Snapshotting write-through cache of a {@link RefDirectory}. * <p> * This is intended to be short-term write-through snapshot based cache used in - * a request scope to avoid re-reading packed-refs on each read. A future - * improvement could also snapshot loose refs. + * a request scope to avoid re-reading packed-refs on each read and to avoid + * refreshing paths to a loose ref that has already been refreshed. * <p> * Only use this class when concurrent writes from other requests (not using the * same instance of SnapshottingRefDirectory) generally need not be visible to @@ -34,6 +40,7 @@ */ class SnapshottingRefDirectory extends RefDirectory { final RefDirectory refDb; + private final Set<File> refreshedLooseRefDirs = ConcurrentHashMap.newKeySet(); private volatile boolean isValid; @@ -67,6 +74,22 @@ PackedRefList getPackedRefs() throws IOException { } @Override + void refreshPathToLooseRef(Path refPath) { + for (int i = 1; i < refPath.getNameCount(); i++) { + File dir = fileFor(refPath.subpath(0, i).toString()); + if (!refreshedLooseRefDirs.contains(dir)) { + try (InputStream stream = Files.newInputStream(dir.toPath())) { + // open the dir to refresh attributes (on some NFS clients) + } catch (IOException e) { + break; // loose ref may not exist + } finally { + refreshedLooseRefDirs.add(dir); + } + } + } + } + + @Override void delete(RefDirectoryUpdate update) throws IOException { refreshSnapshot(); super.delete(update); @@ -107,6 +130,7 @@ RefDirectoryRename createRefDirectoryRename(RefDirectoryUpdate from, } synchronized void invalidateSnapshot() { + refreshedLooseRefDirs.clear(); isValid = false; }
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 30f8240..fd80faf 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
@@ -15,8 +15,10 @@ import java.lang.ref.ReferenceQueue; import java.lang.ref.SoftReference; import java.util.Collections; +import java.util.HashSet; import java.util.Map; import java.util.Random; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicBoolean; @@ -397,7 +399,11 @@ static final ByteWindow get(Pack pack, long offset) } static final void purge(Pack pack) { - cache.removeAll(pack); + purge(Collections.singleton(pack)); + } + + static final void purge(Set<Pack> packs) { + cache.queueRemoveAll(packs); } /** cleanup released and/or garbage collected windows. */ @@ -441,6 +447,29 @@ static final void purge(Pack pack) { private final boolean useStrongIndexRefs; + /** Removers are purely CPU/mem bound (no I/O), so likely should not go above # CPUs */ + private final int idealNumRemovers; + + /** Number of blocks to split the Pack removal into. + * + * Consolidation is better with more blocks since it increases + * the wait before moving to the next set by allowing more work + * to accumulate in the next set. On the flip side, the more + * blocks, the more synchronization overhead increasing each + * removers latency. + */ + private final int numRemovalBlocks; + + private final int removalBlockSize; + + private Set<Pack> packsToRemove = new HashSet<>(); + + private Set<Pack> packsBeingRemoved; + + private int numRemovers; + + private int blockBeingRemoved; + private WindowCache(WindowCacheConfig cfg) { tableSize = tableSize(cfg); final int lockCount = lockCount(cfg); @@ -479,6 +508,23 @@ else if (eb < 4) statsRecorder = mbean; publishMBean.set(cfg.getExposeStatsViaJmx()); + /* Since each worker will only process up to one full set of blocks, at least 2 + * workers are needed anytime there are queued removals to ensure that all the + * blocks will get processed. However, if workers are maxed out at only 2, then + * enough newer workers will never start in order to make it safe for older + * workers to quit early. At least 3 workers are needed to make older worker + * relief transitions possible. + */ + idealNumRemovers = Math.max(3, Runtime.getRuntime().availableProcessors()); + + int bs = 1024; + if (tableSize < 2 * bs) { + bs = tableSize / 2; + } + removalBlockSize = bs; + numRemovalBlocks = tableSize / removalBlockSize; + blockBeingRemoved = numRemovalBlocks - 1; + if (maxFiles < 1) throw new IllegalArgumentException(JGitText.get().openFilesMustBeAtLeast1); if (maxBytes < windowSize) @@ -708,22 +754,103 @@ private void removeAll() { } /** - * Clear all entries related to a single file. + * Asynchronously clear all entries related to files. * <p> - * Typically this method is invoked during {@link Pack#close()}, when we - * know the pack is never going to be useful to us again (for example, it no - * longer exists on disk). A concurrent reader loading an entry from this - * same pack may cause the pack to become stuck in the cache anyway. + * Typically this method is invoked during {@link Pack#close()}, or + * {@link Pack#close(Set)}, when we know the packs are never going to be + * useful to us again (for example, they no longer exist on disk after gc). + * A concurrent reader loading an entry from these same packs may cause a + * pack to become stuck in the cache anyway. * - * @param pack - * the file to purge all entries of. + * Work on clearing files will be split up into blocks so that removing + * can be shared by more than one thread. This potential work sharing + * can provide 2 optimizations for removals: + * <ol> + * <li> It provides an opportunity for separate removal requests to be + * consolidated into one removal pass.</li> + * <li> It can reduce removing thread latencies by sharing the removal work + * with other removing threads which otherwise might not have any work to do + * due to their removal request being consolidated. This makes the system + * more efficient and can actually reduce latencies as system load increases + * due to pack removals!</li> + * </ol> + * The optimizations above are all achieved without blockng threads to wait + * for other threads to complete (although naturally there are some + * synchronization points), and while ensuring that no threads do more work + * than if they were the only thread available to perform a removal. + * + * @param packs + * the files to purge all entries of */ - private void removeAll(Pack pack) { - for (int s = 0; s < tableSize; s++) { + private void queueRemoveAll(Set<Pack> packs) { + synchronized (this) { + packsToRemove.addAll(packs); + if (numRemovers >= idealNumRemovers) { + return; + } + numRemovers++; + } + for (int numRemoved = 0; removeNextBlock(numRemoved); numRemoved++); + synchronized (this) { + if (numRemovers > 0) { + numRemovers--; + } + } + } + + /** Determine which block to remove next, if any, and do so. + * + * @param numRemoved + * the number of already processed block removals by the current thread + * @return whether more processing should be done by the current thread + */ + private boolean removeNextBlock(int numRemoved) { + Set<Pack> toRemove; + int block; + synchronized (this) { + if (packsBeingRemoved == null || blockBeingRemoved >= numRemovalBlocks - 1) { + if (packsToRemove.isEmpty()) { + return false; + } + + blockBeingRemoved = 0; + packsBeingRemoved = packsToRemove; + packsToRemove = new HashSet<>(); + } else { + blockBeingRemoved++; + } + + toRemove = packsBeingRemoved; + block = blockBeingRemoved; + } + + removeBlock(toRemove, block); + numRemoved++; + + /* Ensure threads never work on more than a full set of blocks (the equivalent + * of removing one Pack) */ + boolean isLast = numRemoved >= numRemovalBlocks; + synchronized (this) { + if (numRemovers >= idealNumRemovers) { + isLast = true; + } + } + return !isLast; + } + + /** Remove a block of entries for a Set of files + * @param packs + * the files to purge all entries of + * @param block + * the specific block to process removals for + */ + private void removeBlock(Set<Pack> packs, int block) { + int starting = block * removalBlockSize; + for (int s = starting; s < starting + removalBlockSize && s < tableSize; s++) { final Entry e1 = table.get(s); boolean hasDead = false; for (Entry e = e1; e != null; e = e.next) { - if (e.ref.getPack() == pack) { + if (packs.contains(e.ref.getPack())) { e.kill(); hasDead = true; } else if (e.dead)
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/memory/TernarySearchTree.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/memory/TernarySearchTree.java index acc1c83..72434db 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/memory/TernarySearchTree.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/memory/TernarySearchTree.java
@@ -9,9 +9,9 @@ */ package org.eclipse.jgit.internal.storage.memory; +import java.util.ArrayDeque; import java.util.ArrayList; import java.util.HashMap; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -340,7 +340,7 @@ public String keyLongestPrefixOf(String query) { * @return all keys */ public Iterable<String> getKeys() { - Queue<String> queue = new LinkedList<>(); + Queue<String> queue = new ArrayDeque<>(); lock.readLock().lock(); try { findKeysWithPrefix(root, new StringBuilder(), queue); @@ -358,7 +358,7 @@ public Iterable<String> getKeys() { * @return keys starting with given prefix */ public Iterable<String> getKeysWithPrefix(String prefix) { - Queue<String> keys = new LinkedList<>(); + Queue<String> keys = new ArrayDeque<>(); if (prefix == null) { return keys; } @@ -486,7 +486,7 @@ public List<Value> getValuesWithPrefix(String prefix) { * @return keys matching given pattern. */ public Iterable<String> getKeysMatching(String pattern) { - Queue<String> keys = new LinkedList<>(); + Queue<String> keys = new ArrayDeque<>(); lock.readLock().lock(); try { findKeysWithPrefix(root, new StringBuilder(), 0, pattern, keys);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java index 9a3f4b0..03d6f16 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java
@@ -11,10 +11,10 @@ package org.eclipse.jgit.internal.storage.pack; import java.io.IOException; +import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.concurrent.Callable; @@ -232,14 +232,15 @@ final int size() { } private final Block block; - final LinkedList<Slice> slices; + + final ArrayDeque<Slice> slices; private ObjectReader or; private DeltaWindow dw; DeltaTask(Block b) { this.block = b; - this.slices = new LinkedList<>(); + this.slices = new ArrayDeque<>(); } void add(Slice s) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackBitmapIndexWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackBitmapIndexWriter.java new file mode 100644 index 0000000..9cf8c7f --- /dev/null +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackBitmapIndexWriter.java
@@ -0,0 +1,33 @@ +/* + * Copyright (C) 2024, Google Inc. + * + * 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.internal.storage.pack; + +import java.io.IOException; + +import org.eclipse.jgit.internal.storage.file.PackBitmapIndexBuilder; + +/** + * Represents a function that accepts a collection of bitmaps and write them + * into storage. + */ +@FunctionalInterface +public interface PackBitmapIndexWriter { + /** + * @param bitmaps + * list of bitmaps to be written to a bitmap index + * @param packChecksum + * checksum of the pack that the bitmap index refers to + * @throws IOException + * thrown in case of IO errors while writing the bitmap index + */ + public void write(PackBitmapIndexBuilder bitmaps, byte[] packChecksum) + throws IOException; +} \ No newline at end of file
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java index 9e95231..4350f97 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java
@@ -58,11 +58,10 @@ import org.eclipse.jgit.errors.SearchForReuseTimeout; import org.eclipse.jgit.errors.StoredObjectRepresentationNotAvailableException; import org.eclipse.jgit.internal.JGitText; -import org.eclipse.jgit.internal.storage.file.PackBitmapIndexBuilder; -import org.eclipse.jgit.internal.storage.file.PackBitmapIndexWriterV1; import org.eclipse.jgit.internal.storage.file.PackIndexWriter; import org.eclipse.jgit.internal.storage.file.PackObjectSizeIndexWriter; import org.eclipse.jgit.internal.storage.file.PackReverseIndexWriter; +import org.eclipse.jgit.internal.storage.file.PackBitmapIndexBuilder; import org.eclipse.jgit.lib.AnyObjectId; import org.eclipse.jgit.lib.AsyncObjectSizeQueue; import org.eclipse.jgit.lib.BatchingProgressMonitor; @@ -121,7 +120,7 @@ * pack is being stored as a file the matching index can be written out after * writing the pack by {@link #writeIndex(OutputStream)}. An optional bitmap * index can be made by calling {@link #prepareBitmapIndex(ProgressMonitor)} - * followed by {@link #writeBitmapIndex(OutputStream)}. + * followed by {@link #writeBitmapIndex(PackBitmapIndexWriter)}. * </p> * <p> * Class provide set of configurable options and @@ -1130,7 +1129,7 @@ public void writeIndex(OutputStream indexStream) throws IOException { * Called after * {@link #writePack(ProgressMonitor, ProgressMonitor, OutputStream)} that * populates the list of objects to pack and before - * {@link #writeBitmapIndex(OutputStream)} that destroys it. + * {@link #writeBitmapIndex(PackBitmapIndexWriter)} that destroys it. * <p> * Writing this index is only required for local pack storage. Packs sent on * the network do not need to create an object size index. @@ -1204,20 +1203,18 @@ public void writeReverseIndex(OutputStream stream) throws IOException { * <p> * Called after {@link #prepareBitmapIndex(ProgressMonitor)}. * - * @param bitmapIndexStream - * output for the bitmap index data. Caller is responsible for - * closing this stream. + * @param bitmapIndexWriter + * a writer to store the bitmap index in this object database * @throws java.io.IOException - * the index data could not be written to the supplied stream. + * the index data could not be written using the supplied writer */ - public void writeBitmapIndex(OutputStream bitmapIndexStream) + public void writeBitmapIndex(PackBitmapIndexWriter bitmapIndexWriter) throws IOException { if (writeBitmaps == null) throw new IOException(JGitText.get().bitmapsMustBePrepared); long writeStart = System.currentTimeMillis(); - final PackBitmapIndexWriterV1 iw = new PackBitmapIndexWriterV1(bitmapIndexStream); - iw.write(writeBitmaps, packcsum); + bitmapIndexWriter.write(writeBitmaps, packcsum); stats.timeWriting += System.currentTimeMillis() - writeStart; } @@ -2468,7 +2465,8 @@ private final boolean have(ObjectToPack ptr, AnyObjectId objectId) { * <p> * To reduce memory internal state is cleared during this method, rendering * the PackWriter instance useless for anything further than a call to write - * out the new bitmaps with {@link #writeBitmapIndex(OutputStream)}. + * out the new bitmaps with + * {@link #writeBitmapIndex(PackBitmapIndexWriter)}. * * @param pm * progress monitor to report bitmap building work.
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/transport/ssh/OpenSshConfigFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/transport/ssh/OpenSshConfigFile.java index 29a2922..3e75a9d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/transport/ssh/OpenSshConfigFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/transport/ssh/OpenSshConfigFile.java
@@ -22,7 +22,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; @@ -100,7 +99,7 @@ public class OpenSshConfigFile implements SshConfigStore { * fully resolved entries created from that. */ private static class State { - List<HostEntry> entries = new LinkedList<>(); + List<HostEntry> entries = new ArrayList<>(); // Previous lookups, keyed by user@hostname:port Map<String, HostEntry> hosts = new HashMap<>(); @@ -218,7 +217,7 @@ private synchronized State refresh() { private List<HostEntry> parse(BufferedReader reader) throws IOException { - final List<HostEntry> entries = new LinkedList<>(); + final List<HostEntry> entries = new ArrayList<>(); // The man page doesn't say so, but the openssh parser (readconf.c) // starts out in active mode and thus always applies any lines that
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/util/CleanupService.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/util/CleanupService.java new file mode 100644 index 0000000..29ed756 --- /dev/null +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/util/CleanupService.java
@@ -0,0 +1,121 @@ +/* + * Copyright (C) 2024, Thomas Wolf <twolf@apache.org> and others + * + * 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.internal.util; + +import org.eclipse.jgit.internal.JGitText; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * A class that is registered as an OSGi service via the manifest. If JGit runs + * in OSGi, OSGi will instantiate a singleton as soon as the bundle is activated + * since this class is an immediate OSGi component with no dependencies. OSGi + * will then call its {@link #start()} method. If JGit is not running in OSGi, + * {@link #getInstance()} will lazily create an instance. + * <p> + * An OSGi-created {@link CleanupService} will run the registered cleanup when + * the {@code org.eclipse.jgit} bundle is deactivated. A lazily created instance + * will register the cleanup as a JVM shutdown hook. + * </p> + */ +public final class CleanupService { + + private static final Logger LOG = LoggerFactory + .getLogger(CleanupService.class); + + private static final Object LOCK = new Object(); + + private static CleanupService INSTANCE; + + private final boolean isOsgi; + + private JGitText jgitText; + + private Runnable cleanup; + + /** + * Public component constructor for OSGi DS. Do <em>not</em> call this + * explicitly! (Unfortunately this constructor must be public because of + * OSGi requirements.) + */ + public CleanupService() { + this.isOsgi = true; + setInstance(this); + } + + private CleanupService(boolean isOsgi) { + this.isOsgi = isOsgi; + } + + private static void setInstance(CleanupService service) { + synchronized (LOCK) { + INSTANCE = service; + } + } + + /** + * Obtains the singleton instance of the {@link CleanupService} that knows + * whether or not it is running on OSGi. + * + * @return the {@link CleanupService} singleton instance + */ + public static CleanupService getInstance() { + synchronized (LOCK) { + if (INSTANCE == null) { + INSTANCE = new CleanupService(false); + } + return INSTANCE; + } + } + + void start() { + // Nothing to do + } + + void register(Runnable cleanUp) { + if (isOsgi) { + cleanup = cleanUp; + } else { + // Ensure the JGitText class is loaded. Depending on the framework + // JGit runs in, it may not be possible anymore to load classes when + // the hook runs. For instance when run in a maven plug-in: the + // Plexus class world that loaded JGit may already have been + // disposed by the time the JVM shutdown hook runs when the whole + // maven build terminates. + jgitText = JGitText.get(); + assert jgitText != null; + try { + Runtime.getRuntime().addShutdownHook(new Thread(() -> { + try { + cleanUp.run(); + // Don't catch exceptions; let the JVM do the problem + // reporting. + } finally { + jgitText = null; + } + })); + } catch (IllegalStateException e) { + // Ignore -- the JVM is already shutting down. + } + } + } + + void shutDown() { + if (isOsgi && cleanup != null) { + Runnable r = cleanup; + cleanup = null; + try { + r.run(); + } catch (RuntimeException e) { + LOG.error(JGitText.get().shutdownCleanupFailed, e); + } + } + } +}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/util/Optionally.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/util/Optionally.java index 3447f66..270b760 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/util/Optionally.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/util/Optionally.java
@@ -53,24 +53,24 @@ public class Hard<T> implements Optionally<T> { /** * The mutable optional object */ - protected T element; + protected Optional<T> optional; /** * @param element * the mutable optional object */ public Hard(T element) { - this.element = element; + optional = Optional.ofNullable(element); } @Override public void clear() { - element = null; + optional = Optional.empty(); } @Override public Optional<T> getOptional() { - return Optional.ofNullable(element); + return optional; } }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/util/ShutdownHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/util/ShutdownHook.java index f52025f..f6b4723 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/util/ShutdownHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/util/ShutdownHook.java
@@ -15,17 +15,21 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import java.util.concurrent.RejectedExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import java.util.concurrent.atomic.AtomicBoolean; import org.eclipse.jgit.internal.JGitText; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * A hook registered as a JVM shutdown hook managing a set of objects needing - * cleanup during JVM shutdown. See {@link Runtime#addShutdownHook}. + * The singleton {@link ShutdownHook} provides a means to register + * {@link Listener}s that are run when JGit is uninstalled, either + * <ul> + * <li>in an OSGi framework when this bundle is deactivated, or</li> + * <li>otherwise, when the JVM as a whole shuts down.</li> + * </ul> */ @SuppressWarnings("ImmutableEnumChecker") public enum ShutdownHook { @@ -35,11 +39,11 @@ public enum ShutdownHook { INSTANCE; /** - * Object that needs to cleanup on JVM shutdown. + * Object that needs to cleanup on shutdown. */ public interface Listener { /** - * Cleanup resources when JVM shuts down, called from JVM shutdown hook. + * Cleanup resources when JGit is shut down. * <p> * Implementations should be coded defensively * <ul> @@ -62,31 +66,27 @@ public interface Listener { private final Set<Listener> listeners = ConcurrentHashMap.newKeySet(); - private volatile boolean shutdownInProgress; + private final AtomicBoolean shutdownInProgress = new AtomicBoolean(); private ShutdownHook() { - try { - Runtime.getRuntime().addShutdownHook(new Thread(this::cleanup)); - } catch (IllegalStateException e) { - // ignore - the VM is already shutting down - } + CleanupService.getInstance().register(this::cleanup); } private void cleanup() { - shutdownInProgress = true; - ExecutorService runner = Executors.newWorkStealingPool(); - try { - runner.submit(() -> { - this.doCleanup(); - return null; - }).get(30L, TimeUnit.SECONDS); - } catch (RejectedExecutionException | InterruptedException - | ExecutionException | TimeoutException e) { - // message isn't localized since during shutdown there's no - // guarantee which classes are still loaded - LOG.error("Cleanup during JVM shutdown failed", e); //$NON-NLS-1$ + if (!shutdownInProgress.getAndSet(true)) { + ExecutorService runner = Executors.newWorkStealingPool(); + try { + runner.submit(() -> { + this.doCleanup(); + return null; + }).get(30L, TimeUnit.SECONDS); + } catch (InterruptedException | ExecutionException + | TimeoutException e) { + throw new RuntimeException(e.getMessage(), e); + } finally { + runner.shutdownNow(); + } } - runner.shutdownNow(); } private void doCleanup() { @@ -104,17 +104,17 @@ private void notify(Listener l) { } /** - * Register object that needs cleanup during JVM shutdown if it is not - * already registered. Registration is disabled when JVM shutdown is already - * in progress. + * Register object that needs cleanup during JGit shutdown if it is not + * already registered. Registration is disabled when JGit shutdown is + * already in progress. * * @param l - * the object to call {@link Listener#onShutdown} on when JVM + * the object to call {@link Listener#onShutdown} on when JGit * shuts down * @return {@code true} if this object has been registered */ public boolean register(Listener l) { - if (shutdownInProgress) { + if (shutdownInProgress.get()) { return listeners.contains(l); } LOG.debug("register {} with shutdown hook", l); //$NON-NLS-1$ @@ -123,8 +123,8 @@ public boolean register(Listener l) { } /** - * Unregister object that no longer needs cleanup during JVM shutdown if it - * is still registered. Unregistration is disabled when JVM shutdown is + * Unregister object that no longer needs cleanup during JGit shutdown if it + * is still registered. Unregistration is disabled when JGit shutdown is * already in progress. * * @param l @@ -133,7 +133,7 @@ public boolean register(Listener l) { * @return {@code true} if this object is no longer registered */ public boolean unregister(Listener l) { - if (shutdownInProgress) { + if (shutdownInProgress.get()) { return !listeners.contains(l); } LOG.debug("unregister {} from shutdown hook", l); //$NON-NLS-1$ @@ -142,11 +142,11 @@ public boolean unregister(Listener l) { } /** - * Whether a JVM shutdown is in progress + * Whether a JGit shutdown is in progress * - * @return {@code true} if a JVM shutdown is in progress + * @return {@code true} if a JGit shutdown is in progress */ public boolean isShutdownInProgress() { - return shutdownInProgress; + return shutdownInProgress.get(); } }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java index 60a23dd..1a2f735 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java
@@ -12,10 +12,14 @@ package org.eclipse.jgit.lib; +import static java.nio.charset.StandardCharsets.US_ASCII; import static java.nio.charset.StandardCharsets.UTF_8; -import java.nio.ByteBuffer; import java.nio.charset.Charset; +import java.nio.CharBuffer; +import java.nio.charset.CharacterCodingException; +import java.nio.charset.CharsetEncoder; +import java.nio.charset.CodingErrorAction; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.text.MessageFormat; @@ -494,6 +498,13 @@ public final class Constants { public static final String ATTR_BUILTIN_BINARY_MERGER = "binary"; //$NON-NLS-1$ /** + * Union built-in merge driver + * + * @since 6.10.1 + */ + public static final String ATTR_BUILTIN_UNION_MERGE_DRIVER = "union"; //$NON-NLS-1$ + + /** * Create a new digest function for objects. * * @return a new digest object. @@ -661,14 +672,15 @@ public static int decodeTypeString(final AnyObjectId id, * the 7-bit ASCII character space. */ public static byte[] encodeASCII(String s) { - final byte[] r = new byte[s.length()]; - for (int k = r.length - 1; k >= 0; k--) { - final char c = s.charAt(k); - if (c > 127) - throw new IllegalArgumentException(MessageFormat.format(JGitText.get().notASCIIString, s)); - r[k] = (byte) c; + try { + CharsetEncoder encoder = US_ASCII.newEncoder() + .onUnmappableCharacter(CodingErrorAction.REPORT) + .onMalformedInput(CodingErrorAction.REPORT); + return encoder.encode(CharBuffer.wrap(s)).array(); + } catch (CharacterCodingException e) { + throw new IllegalArgumentException( + MessageFormat.format(JGitText.get().notASCIIString, s), e); } - return r; } /** @@ -681,17 +693,7 @@ public static int decodeTypeString(final AnyObjectId id, * @see #CHARACTER_ENCODING */ public static byte[] encode(String str) { - final ByteBuffer bb = UTF_8.encode(str); - final int len = bb.limit(); - if (bb.hasArray() && bb.arrayOffset() == 0) { - final byte[] arr = bb.array(); - if (arr.length == len) - return arr; - } - - final byte[] arr = new byte[len]; - bb.get(arr); - return arr; + return str.getBytes(UTF_8); } static {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java index c716f46..b036a0b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java
@@ -17,7 +17,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import org.eclipse.jgit.lib.RebaseTodoLine.Action; @@ -62,7 +62,7 @@ public List<RebaseTodoLine> readRebaseTodo(String path, byte[] buf = IO.readFully(new File(repo.getDirectory(), path)); int ptr = 0; int tokenBegin = 0; - List<RebaseTodoLine> r = new LinkedList<>(); + List<RebaseTodoLine> r = new ArrayList<>(); while (ptr < buf.length) { tokenBegin = ptr; ptr = RawParseUtils.nextLF(buf, ptr);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ContentMergeStrategy.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ContentMergeStrategy.java index 6d56864..a835a1d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ContentMergeStrategy.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ContentMergeStrategy.java
@@ -23,5 +23,12 @@ public enum ContentMergeStrategy { OURS, /** Resolve the conflict hunk using the theirs version. */ - THEIRS -} \ No newline at end of file + THEIRS, + + /** + * Resolve the conflict hunk using a union of both ours and theirs versions. + * + * @since 6.10.1 + */ + UNION +}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeAlgorithm.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeAlgorithm.java index b902492..d0d4d36 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeAlgorithm.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeAlgorithm.java
@@ -120,6 +120,7 @@ public <S extends Sequence> MergeResult<S> merge( result.add(1, 0, 0, ConflictState.NO_CONFLICT); break; case THEIRS: + case UNION: result.add(2, 0, theirs.size(), ConflictState.NO_CONFLICT); break; @@ -148,6 +149,7 @@ public <S extends Sequence> MergeResult<S> merge( // we modified, they deleted switch (strategy) { case OURS: + case UNION: result.add(1, 0, ours.size(), ConflictState.NO_CONFLICT); break; case THEIRS: @@ -158,7 +160,7 @@ public <S extends Sequence> MergeResult<S> merge( result.add(1, 0, ours.size(), ConflictState.FIRST_CONFLICTING_RANGE); result.add(0, 0, base.size(), - ConflictState.BASE_CONFLICTING_RANGE); + ConflictState.BASE_CONFLICTING_RANGE); result.add(2, 0, 0, ConflictState.NEXT_CONFLICTING_RANGE); break; } @@ -218,13 +220,18 @@ public <S extends Sequence> MergeResult<S> merge( // set some initial values for the ranges in A and B which we // want to handle + int oursBeginA = oursEdit.getBeginA(); + int theirsBeginA = theirsEdit.getBeginA(); int oursBeginB = oursEdit.getBeginB(); int theirsBeginB = theirsEdit.getBeginB(); // harmonize the start of the ranges in A and B if (oursEdit.getBeginA() < theirsEdit.getBeginA()) { + theirsBeginA -= theirsEdit.getBeginA() + - oursEdit.getBeginA(); theirsBeginB -= theirsEdit.getBeginA() - oursEdit.getBeginA(); } else { + oursBeginA -= oursEdit.getBeginA() - theirsEdit.getBeginA(); oursBeginB -= oursEdit.getBeginA() - theirsEdit.getBeginA(); } @@ -270,11 +277,15 @@ public <S extends Sequence> MergeResult<S> merge( } // harmonize the end of the ranges in A and B + int oursEndA = oursEdit.getEndA(); + int theirsEndA = theirsEdit.getEndA(); int oursEndB = oursEdit.getEndB(); int theirsEndB = theirsEdit.getEndB(); if (oursEdit.getEndA() < theirsEdit.getEndA()) { + oursEndA += theirsEdit.getEndA() - oursEdit.getEndA(); oursEndB += theirsEdit.getEndA() - oursEdit.getEndA(); } else { + theirsEndA += oursEdit.getEndA() - theirsEdit.getEndA(); theirsEndB += oursEdit.getEndA() - theirsEdit.getEndA(); } @@ -324,15 +335,24 @@ public <S extends Sequence> MergeResult<S> merge( theirsEndB - commonSuffix, ConflictState.NO_CONFLICT); break; + case UNION: + result.add(1, oursBeginB + commonPrefix, + oursEndB - commonSuffix, + ConflictState.NO_CONFLICT); + + result.add(2, theirsBeginB + commonPrefix, + theirsEndB - commonSuffix, + ConflictState.NO_CONFLICT); + break; default: result.add(1, oursBeginB + commonPrefix, oursEndB - commonSuffix, ConflictState.FIRST_CONFLICTING_RANGE); - int baseBegin = Math.min(oursBeginB, theirsBeginB) + int baseBegin = Math.min(oursBeginA, theirsBeginA) + commonPrefix; int baseEnd = Math.min(base.size(), - Math.max(oursEndB, theirsEndB)) - commonSuffix; + Math.max(oursEndA, theirsEndA)) - commonSuffix; result.add(0, baseBegin, baseEnd, ConflictState.BASE_CONFLICTING_RANGE);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java index 13cccee..a50a644 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java
@@ -32,7 +32,6 @@ import java.util.Arrays; import java.util.Collections; import java.util.HashMap; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Objects; @@ -42,6 +41,7 @@ import org.eclipse.jgit.annotations.Nullable; import org.eclipse.jgit.attributes.Attribute; import org.eclipse.jgit.attributes.Attributes; +import org.eclipse.jgit.attributes.AttributesNodeProvider; import org.eclipse.jgit.diff.DiffAlgorithm; import org.eclipse.jgit.diff.DiffAlgorithm.SupportedAlgorithm; import org.eclipse.jgit.diff.RawText; @@ -106,9 +106,9 @@ protected static class WorkTreeUpdater implements Closeable { */ public static class Result { - private final List<String> modifiedFiles = new LinkedList<>(); + private final List<String> modifiedFiles = new ArrayList<>(); - private final List<String> failedToDelete = new LinkedList<>(); + private final List<String> failedToDelete = new ArrayList<>(); private ObjectId treeId = null; @@ -838,6 +838,13 @@ public enum MergeFailureReason { @NonNull private ContentMergeStrategy contentStrategy = ContentMergeStrategy.CONFLICT; + /** + * The {@link AttributesNodeProvider} to use while merging trees. + * + * @since 6.10.1 + */ + protected AttributesNodeProvider attributesNodeProvider; + private static MergeAlgorithm getMergeAlgorithm(Config config) { SupportedAlgorithm diffAlg = config.getEnum( CONFIG_DIFF_SECTION, null, CONFIG_KEY_ALGORITHM, @@ -1274,10 +1281,15 @@ protected boolean processEntry(CanonicalTreeParser base, default: break; } + // add the conflicting path to merge result + String currentPath = tw.getPathString(); + MergeResult<RawText> result = new MergeResult<>( + Collections.emptyList()); + result.setContainsConflicts(true); + mergeResults.put(currentPath, result); addConflict(base, ours, theirs); - // attribute merge issues are conflicts but not failures - unmergedPaths.add(tw.getPathString()); + unmergedPaths.add(currentPath); return true; } @@ -1289,38 +1301,48 @@ protected boolean processEntry(CanonicalTreeParser base, MergeResult<RawText> result = null; boolean hasSymlink = FileMode.SYMLINK.equals(modeO) || FileMode.SYMLINK.equals(modeT); + + String currentPath = tw.getPathString(); + // if the path is not a symlink in ours and theirs if (!hasSymlink) { try { result = contentMerge(base, ours, theirs, attributes, getContentMergeStrategy()); - } catch (BinaryBlobException e) { - // result == null - } - } - if (result == null) { - switch (getContentMergeStrategy()) { - case OURS: - keep(ourDce); - return true; - case THEIRS: - DirCacheEntry e = add(tw.getRawPath(), theirs, - DirCacheEntry.STAGE_0, EPOCH, 0); - if (e != null) { - addToCheckout(tw.getPathString(), e, attributes); + if (result.containsConflicts() && !ignoreConflicts) { + result.setContainsConflicts(true); + unmergedPaths.add(currentPath); + } else if (ignoreConflicts) { + result.setContainsConflicts(false); } + updateIndex(base, ours, theirs, result, attributes[T_OURS]); + workTreeUpdater.markAsModified(currentPath); + // Entry is null - only add the metadata + addToCheckout(currentPath, null, attributes); return true; - default: - result = new MergeResult<>(Collections.emptyList()); - result.setContainsConflicts(true); - break; + } catch (BinaryBlobException e) { + // if the file is binary in either OURS, THEIRS or BASE + // here, we don't have an option to ignore conflicts } } - if (ignoreConflicts) { - result.setContainsConflicts(false); + switch (getContentMergeStrategy()) { + case OURS: + keep(ourDce); + return true; + case THEIRS: + DirCacheEntry e = add(tw.getRawPath(), theirs, + DirCacheEntry.STAGE_0, EPOCH, 0); + if (e != null) { + addToCheckout(currentPath, e, attributes); + } + return true; + default: + result = new MergeResult<>(Collections.emptyList()); + result.setContainsConflicts(true); + break; } - String currentPath = tw.getPathString(); if (hasSymlink) { if (ignoreConflicts) { + result.setContainsConflicts(false); if (((modeT & FileMode.TYPE_MASK) == FileMode.TYPE_FILE)) { DirCacheEntry e = add(tw.getRawPath(), theirs, DirCacheEntry.STAGE_0, EPOCH, 0); @@ -1329,9 +1351,9 @@ protected boolean processEntry(CanonicalTreeParser base, keep(ourDce); } } else { - // Record the conflict DirCacheEntry e = addConflict(base, ours, theirs); mergeResults.put(currentPath, result); + unmergedPaths.add(currentPath); // If theirs is a file, check it out. In link/file // conflicts, C git prefers the file. if (((modeT & FileMode.TYPE_MASK) == FileMode.TYPE_FILE) @@ -1340,14 +1362,12 @@ protected boolean processEntry(CanonicalTreeParser base, } } } else { - updateIndex(base, ours, theirs, result, attributes[T_OURS]); - } - if (result.containsConflicts() && !ignoreConflicts) { + result.setContainsConflicts(true); + addConflict(base, ours, theirs); unmergedPaths.add(currentPath); + mergeResults.put(currentPath, result); } - workTreeUpdater.markAsModified(currentPath); - // Entry is null - only adds the metadata. - addToCheckout(currentPath, null, attributes); + return true; } else if (modeO != modeT) { // OURS or THEIRS has been deleted if (((modeO != 0 && !tw.idEqual(T_BASE, T_OURS)) || (modeT != 0 && !tw @@ -1477,11 +1497,26 @@ private MergeResult<RawText> contentMerge(CanonicalTreeParser base, : getRawText(ours.getEntryObjectId(), attributes[T_OURS]); RawText theirsText = theirs == null ? RawText.EMPTY_TEXT : getRawText(theirs.getEntryObjectId(), attributes[T_THEIRS]); - mergeAlgorithm.setContentMergeStrategy(strategy); + mergeAlgorithm.setContentMergeStrategy( + getAttributesContentMergeStrategy(attributes[T_OURS], + strategy)); return mergeAlgorithm.merge(RawTextComparator.DEFAULT, baseText, ourText, theirsText); } + private ContentMergeStrategy getAttributesContentMergeStrategy( + Attributes attributes, ContentMergeStrategy strategy) { + Attribute attr = attributes.get(Constants.ATTR_MERGE); + if (attr != null) { + String attrValue = attr.getValue(); + if (attrValue != null && attrValue + .equals(Constants.ATTR_BUILTIN_UNION_MERGE_DRIVER)) { + return ContentMergeStrategy.UNION; + } + } + return strategy; + } + private boolean isIndexDirty() { if (inCore) { return false; @@ -1812,6 +1847,18 @@ public void setWorkingTreeIterator(WorkingTreeIterator workingTreeIterator) { this.workingTreeIterator = workingTreeIterator; } + /** + * Sets the {@link AttributesNodeProvider} to be used by this merger. + * + * @param attributesNodeProvider + * the attributeNodeProvider to set + * @since 6.10.1 + */ + public void setAttributesNodeProvider( + AttributesNodeProvider attributesNodeProvider) { + this.attributesNodeProvider = attributesNodeProvider; + } + /** * The resolve conflict way of three way merging @@ -1856,6 +1903,9 @@ protected boolean mergeTrees(AbstractTreeIterator baseTree, WorkTreeUpdater.createWorkTreeUpdater(db, dircache); dircache = workTreeUpdater.getLockedDirCache(); tw = new NameConflictTreeWalk(db, reader); + if (attributesNodeProvider != null) { + tw.setAttributesNodeProvider(attributesNodeProvider); + } tw.addTree(baseTree); tw.setHead(tw.addTree(headTree));
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteMapMerger.java b/org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteMapMerger.java index 79ceb13..30512c1 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteMapMerger.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteMapMerger.java
@@ -199,7 +199,7 @@ private void addIfNotNull(FanoutBucket b, int cell, NoteBucket child) if (child == null) return; if (child instanceof InMemoryNoteBucket) - b.setBucket(cell, ((InMemoryNoteBucket) child).writeTree(inserter)); + b.setBucket(cell, child.writeTree(inserter)); else b.setBucket(cell, child.getTreeId()); }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/patch/PatchApplier.java b/org.eclipse.jgit/src/org/eclipse/jgit/patch/PatchApplier.java index a327095..cb6cc6e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/patch/PatchApplier.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/patch/PatchApplier.java
@@ -23,6 +23,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.nio.ByteBuffer; +import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.StandardCopyOption; @@ -33,9 +34,11 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; import java.util.zip.InflaterInputStream; + import org.eclipse.jgit.annotations.Nullable; import org.eclipse.jgit.api.errors.FilterFailedException; import org.eclipse.jgit.api.errors.PatchFormatException; @@ -101,11 +104,12 @@ * @since 6.4 */ public class PatchApplier { - private static final byte[] NO_EOL = "\\ No newline at end of file" //$NON-NLS-1$ .getBytes(StandardCharsets.US_ASCII); - /** The tree before applying the patch. Only non-null for inCore operation. */ + /** + * The tree before applying the patch. Only non-null for inCore operation. + */ @Nullable private final RevTree beforeTree; @@ -115,10 +119,14 @@ public class PatchApplier { private final ObjectReader reader; + private final Charset charset; + private WorkingTreeOptions workingTreeOptions; private int inCoreSizeLimit; + private boolean allowConflicts; + /** * @param repo * repository to apply the patch in @@ -128,7 +136,8 @@ public PatchApplier(Repository repo) { inserter = repo.newObjectInserter(); reader = inserter.newReader(); beforeTree = null; - + allowConflicts = false; + charset = StandardCharsets.UTF_8; Config config = repo.getConfig(); workingTreeOptions = config.get(WorkingTreeOptions.KEY); inCoreSizeLimit = config.getInt(ConfigConstants.CONFIG_MERGE_SECTION, @@ -143,11 +152,14 @@ public PatchApplier(Repository repo) { * @param oi * to be used for modifying objects */ - public PatchApplier(Repository repo, RevTree beforeTree, ObjectInserter oi) { + public PatchApplier(Repository repo, RevTree beforeTree, + ObjectInserter oi) { this.repo = repo; this.beforeTree = beforeTree; inserter = oi; reader = oi.newReader(); + allowConflicts = false; + charset = StandardCharsets.UTF_8; } /** @@ -157,7 +169,6 @@ public PatchApplier(Repository repo, RevTree beforeTree, ObjectInserter oi) { * @since 6.3 */ public static class Result { - /** * A wrapper for a patch applying error that affects a given file. * @@ -166,28 +177,68 @@ public static class Result { // TODO(ms): rename this class in next major release @SuppressWarnings("JavaLangClash") public static class Error { + final String msg; - private String msg; - private String oldFileName; - private @Nullable HunkHeader hh; + final String oldFileName; - private Error(String msg, String oldFileName, - @Nullable HunkHeader hh) { + @Nullable + final HunkHeader hh; + + final boolean isGitConflict; + + Error(String msg, String oldFileName, @Nullable HunkHeader hh, + boolean isGitConflict) { this.msg = msg; this.oldFileName = oldFileName; this.hh = hh; + this.isGitConflict = isGitConflict; + } + + /** + * Signals if as part of encountering this error, conflict markers + * were added to the file. + * + * @return {@code true} if conflict markers were added for this + * error. + * + * @since 6.10 + */ + public boolean isGitConflict() { + return isGitConflict; } @Override public String toString() { if (hh != null) { - return MessageFormat.format(JGitText.get().patchApplyErrorWithHunk, - oldFileName, hh, msg); + return MessageFormat.format( + JGitText.get().patchApplyErrorWithHunk, oldFileName, + hh, msg); } - return MessageFormat.format(JGitText.get().patchApplyErrorWithoutHunk, - oldFileName, msg); + return MessageFormat.format( + JGitText.get().patchApplyErrorWithoutHunk, oldFileName, + msg); } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || !(o instanceof Error)) { + return false; + } + Error error = (Error) o; + return Objects.equals(msg, error.msg) + && Objects.equals(oldFileName, error.oldFileName) + && Objects.equals(hh, error.hh) + && isGitConflict == error.isGitConflict; + } + + @Override + public int hashCode() { + return Objects.hash(msg, oldFileName, hh, + Boolean.valueOf(isGitConflict)); + } } private ObjectId treeId; @@ -225,8 +276,14 @@ public List<Error> getErrors() { return errors; } - private void addError(String msg,String oldFileName, @Nullable HunkHeader hh) { - errors.add(new Error(msg, oldFileName, hh)); + private void addError(String msg, String oldFileName, + @Nullable HunkHeader hh) { + errors.add(new Error(msg, oldFileName, hh, false)); + } + + private void addErrorWithGitConflict(String msg, String oldFileName, + @Nullable HunkHeader hh) { + errors.add(new Error(msg, oldFileName, hh, true)); } } @@ -357,6 +414,17 @@ else if (!dirCacheBuilder.commit()) { return result; } + /** + * Sets up the {@link PatchApplier} to apply patches even if they conflict. + * + * @return the {@link PatchApplier} to apply any patches + * @since 6.10 + */ + public PatchApplier allowConflicts() { + allowConflicts = true; + return this; + } + private File getFile(String path) { return inCore() ? null : new File(repo.getWorkTree(), path); } @@ -439,6 +507,7 @@ private boolean validGitPath(String path) { return false; } } + private static final int FILE_TREE_INDEX = 1; /** @@ -539,7 +608,9 @@ private void apply(String pathWithOriginalContent, DirCache dirCache, convertCrLf); resultStreamLoader = applyText(raw, fh, result); } - if (resultStreamLoader == null || !result.getErrors().isEmpty()) { + if (resultStreamLoader == null + || (!result.getErrors().isEmpty() && result.getErrors().stream() + .anyMatch(e -> !e.msg.equals("cannot apply hunk")))) { //$NON-NLS-1$ return; } @@ -961,9 +1032,51 @@ && canApplyAt(hunkLines, newLines, 0)) { } } if (!applies) { - result.addError(JGitText.get().applyTextPatchCannotApplyHunk, - fh.getOldPath(), hh); - return null; + if (!allowConflicts) { + result.addError( + JGitText.get().applyTextPatchCannotApplyHunk, + fh.getOldPath(), hh); + return null; + } + // Insert conflict markers. This is best-guess because the + // file might have changed completely. But at least we give + // the user a graceful state that they can resolve manually. + // An alternative to this is using the 3-way merger. This + // only works if the pre-image SHA is contained in the repo. + // If that was the case, cherry-picking the original commit + // should be preferred to apply a patch. + result.addErrorWithGitConflict("cannot apply hunk", fh.getOldPath(), hh); //$NON-NLS-1$ + newLines.add(Math.min(applyAt++, newLines.size()), + asBytes("<<<<<<< HEAD")); //$NON-NLS-1$ + applyAt += hh.getOldImage().lineCount; + newLines.add(Math.min(applyAt++, newLines.size()), + asBytes("=======")); //$NON-NLS-1$ + + int sz = hunkLines.size(); + for (int j = 1; j < sz; j++) { + ByteBuffer hunkLine = hunkLines.get(j); + if (!hunkLine.hasRemaining()) { + // Completely empty line; accept as empty context + // line + applyAt++; + lastWasRemoval = false; + continue; + } + switch (hunkLine.array()[hunkLine.position()]) { + case ' ': + case '+': + newLines.add(Math.min(applyAt++, newLines.size()), + slice(hunkLine, 1)); + break; + case '-': + case '\\': + default: + break; + } + } + newLines.add(Math.min(applyAt++, newLines.size()), + asBytes(">>>>>>> PATCH")); //$NON-NLS-1$ + continue; } // Hunk applies at applyAt. Apply it, and update afterLastHunk and // lineNumberShift @@ -1010,7 +1123,11 @@ && canApplyAt(hunkLines, newLines, 0)) { } else if (!rt.isMissingNewlineAtEnd()) { newLines.add(null); } + return toContentStreamLoader(newLines); + } + private static ContentStreamLoader toContentStreamLoader( + List<ByteBuffer> newLines) throws IOException { // We could check if old == new, but the short-circuiting complicates // logic for inCore patching, so just write the new thing regardless. TemporaryBuffer buffer = new TemporaryBuffer.LocalFile(null); @@ -1034,6 +1151,10 @@ && canApplyAt(hunkLines, newLines, 0)) { } } + private ByteBuffer asBytes(String str) { + return ByteBuffer.wrap(str.getBytes(charset)); + } + @SuppressWarnings("ByteBufferBackingArray") private boolean canApplyAt(List<ByteBuffer> hunkLines, List<ByteBuffer> newLines, int line) { @@ -1123,4 +1244,4 @@ public void close() throws IOException { in.close(); } } -} +} \ No newline at end of file
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java index a213dd4..be29dc3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java
@@ -12,7 +12,7 @@ import java.io.IOException; import java.text.MessageFormat; -import java.util.LinkedList; +import java.util.ArrayDeque; import org.eclipse.jgit.errors.IncorrectObjectTypeException; import org.eclipse.jgit.errors.MissingObjectException; @@ -47,7 +47,8 @@ class MergeBaseGenerator extends Generator { private int recarryTest; private int recarryMask; private int mergeBaseAncestor = -1; - private LinkedList<RevCommit> ret = new LinkedList<>(); + + private ArrayDeque<RevCommit> ret = new ArrayDeque<>(); private CarryStack stack;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java index 76c14e9..9714fab 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java
@@ -19,9 +19,14 @@ import java.util.ArrayList; import java.util.Collection; import java.util.EnumSet; +import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.List; -import java.util.Optional; +import java.util.Map; +import java.util. +Optional; +import java.util.Set; import org.eclipse.jgit.annotations.NonNull; import org.eclipse.jgit.annotations.Nullable; @@ -540,6 +545,27 @@ public boolean isMergedIntoAny(RevCommit commit, Collection<Ref> refs) } /** + * Determine if a <code>commit</code> is merged into any of the given + * <code>revs</code>. + * + * @param commit + * commit the caller thinks is reachable from <code>revs</code>. + * @param revs + * commits to start iteration from, and which is most likely a + * descendant (child) of <code>commit</code>. + * @return true if commit is merged into any of the revs; false otherwise. + * @throws java.io.IOException + * a pack file or loose object could not be read. + * @since 6.10.1 + */ + public boolean isMergedIntoAnyCommit(RevCommit commit, Collection<RevCommit> revs) + throws IOException { + return getCommitsMergedInto(commit, revs, + GetMergedIntoStrategy.RETURN_ON_FIRST_FOUND, + NullProgressMonitor.INSTANCE).size() > 0; + } + + /** * Determine if a <code>commit</code> is merged into all of the given * <code>refs</code>. * @@ -562,7 +588,26 @@ public boolean isMergedIntoAll(RevCommit commit, Collection<Ref> refs) private List<Ref> getMergedInto(RevCommit needle, Collection<Ref> haystacks, Enum returnStrategy, ProgressMonitor monitor) throws IOException { + Map<RevCommit, List<Ref>> refsByCommit = new HashMap<>(); + for (Ref r : haystacks) { + RevObject o = peel(parseAny(r.getObjectId())); + if (!(o instanceof RevCommit)) { + continue; + } + refsByCommit.computeIfAbsent((RevCommit) o, c -> new ArrayList<>()).add(r); + } + monitor.update(1); List<Ref> result = new ArrayList<>(); + for (RevCommit c : getCommitsMergedInto(needle, refsByCommit.keySet(), + returnStrategy, monitor)) { + result.addAll(refsByCommit.get(c)); + } + return result; + } + + private Set<RevCommit> getCommitsMergedInto(RevCommit needle, Collection<RevCommit> haystacks, + Enum returnStrategy, ProgressMonitor monitor) throws IOException { + Set<RevCommit> result = new HashSet<>(); List<RevCommit> uninteresting = new ArrayList<>(); List<RevCommit> marked = new ArrayList<>(); RevFilter oldRF = filter; @@ -578,16 +623,11 @@ private List<Ref> getMergedInto(RevCommit needle, Collection<Ref> haystacks, needle.parseHeaders(this); } int cutoff = needle.getGeneration(); - for (Ref r : haystacks) { + for (RevCommit c : haystacks) { if (monitor.isCancelled()) { return result; } monitor.update(1); - RevObject o = peel(parseAny(r.getObjectId())); - if (!(o instanceof RevCommit)) { - continue; - } - RevCommit c = (RevCommit) o; reset(UNINTERESTING | TEMP_MARK); markStart(c); boolean commitFound = false; @@ -599,7 +639,7 @@ private List<Ref> getMergedInto(RevCommit needle, Collection<Ref> haystacks, } if (References.isSameObject(next, needle) || (next.flags & TEMP_MARK) != 0) { - result.add(r); + result.add(c); if (returnStrategy == GetMergedIntoStrategy.RETURN_ON_FIRST_FOUND) { return result; }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TreeRevFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TreeRevFilter.java index 43571a6..99943b7 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TreeRevFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TreeRevFilter.java
@@ -139,11 +139,8 @@ public boolean include(RevWalk walker, RevCommit c) .getPathsBestEffort(); if (paths.isPresent()) { changedPathFilterUsed = true; - for (byte[] path : paths.get()) { - if (!cpf.maybeContains(path)) { - mustCalculateChgs = false; - break; - } + if (paths.get().stream().noneMatch(cpf::maybeContains)) { + mustCalculateChgs = false; } } }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java index 4a02d6d..b335675 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java
@@ -33,10 +33,8 @@ import java.util.Collections; import java.util.Enumeration; import java.util.LinkedHashSet; -import java.util.LinkedList; import java.util.List; import java.util.Map; -import java.util.Vector; import java.util.concurrent.CopyOnWriteArrayList; import org.eclipse.jgit.annotations.NonNull; @@ -109,7 +107,7 @@ private static Enumeration<URL> catalogs(ClassLoader ldr) { String name = prefix + Transport.class.getName(); return ldr.getResources(name); } catch (IOException err) { - return new Vector<URL>().elements(); + return Collections.emptyEnumeration(); } } @@ -595,7 +593,7 @@ public static Collection<RemoteRefUpdate> findRemoteRefUpdatesFor( Collection<RefSpec> fetchSpecs) throws IOException { if (fetchSpecs == null) fetchSpecs = Collections.emptyList(); - final List<RemoteRefUpdate> result = new LinkedList<>(); + final List<RemoteRefUpdate> result = new ArrayList<>(); final Collection<RefSpec> procRefs = expandPushWildcardsFor(db, specs); for (RefSpec spec : procRefs) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java index 3162b89..a65d0b7 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java
@@ -66,7 +66,6 @@ import java.util.EnumSet; import java.util.HashSet; import java.util.LinkedHashSet; -import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.Map; @@ -763,7 +762,7 @@ private HttpConnection connect(String service, void processResponseCookies(HttpConnection conn) { if (cookieFile != null && http.getSaveCookies()) { - List<HttpCookie> foundCookies = new LinkedList<>(); + List<HttpCookie> foundCookies = new ArrayList<>(); List<String> cookieHeaderValues = conn .getHeaderFields(HDR_SET_COOKIE); @@ -795,7 +794,7 @@ void processResponseCookies(HttpConnection conn) { private List<HttpCookie> extractCookies(String headerKey, List<String> headerValues) { - List<HttpCookie> foundCookies = new LinkedList<>(); + List<HttpCookie> foundCookies = new ArrayList<>(); for (String headerValue : headerValues) { foundCookies .addAll(HttpCookie.parse(headerKey + ':' + headerValue));
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java index 1dcfe56..fbea704 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
@@ -118,13 +118,13 @@ public class UploadPack implements Closeable { /** Policy the server uses to validate client requests */ public enum RequestPolicy { /** Client may only ask for objects the server advertised a reference for. */ - ADVERTISED, + ADVERTISED(0x08), /** * Client may ask for any commit reachable from a reference advertised by * the server. */ - REACHABLE_COMMIT, + REACHABLE_COMMIT(0x02), /** * Client may ask for objects that are the tip of any reference, even if not @@ -134,18 +134,36 @@ public enum RequestPolicy { * * @since 3.1 */ - TIP, + TIP(0x01), /** * Client may ask for any commit reachable from any reference, even if that - * reference wasn't advertised. + * reference wasn't advertised, implies REACHABLE_COMMIT and TIP. * * @since 3.1 */ - REACHABLE_COMMIT_TIP, + REACHABLE_COMMIT_TIP(0x03), - /** Client may ask for any SHA-1 in the repository. */ - ANY; + /** Client may ask for any SHA-1 in the repository, implies REACHABLE_COMMIT_TIP. */ + ANY(0x07); + + private final int bitmask; + + RequestPolicy(int bitmask) { + this.bitmask = bitmask; + } + + /** + * Check if the current policy implies another, based on its bitmask. + * + * @param implied + * the implied policy based on its bitmask. + * @return true if the policy is implied. + * @since 6.10.1 + */ + public boolean implies(RequestPolicy implied) { + return (bitmask & implied.bitmask) != 0; + } } /** @@ -1423,6 +1441,7 @@ private List<String> getV2CapabilityAdvertisement() { if (transferConfig.isAdvertiseObjectInfo()) { caps.add(COMMAND_OBJECT_INFO); } + caps.add(OPTION_AGENT + "=" + UserAgent.get()); return caps; } @@ -1629,13 +1648,9 @@ public void sendAdvertisedRefs(RefAdvertiser adv, if (!biDirectionalPipe) adv.advertiseCapability(OPTION_NO_DONE); RequestPolicy policy = getRequestPolicy(); - if (policy == RequestPolicy.TIP - || policy == RequestPolicy.REACHABLE_COMMIT_TIP - || policy == null) + if (policy == null || policy.implies(RequestPolicy.TIP)) adv.advertiseCapability(OPTION_ALLOW_TIP_SHA1_IN_WANT); - if (policy == RequestPolicy.REACHABLE_COMMIT - || policy == RequestPolicy.REACHABLE_COMMIT_TIP - || policy == null) + if (policy == null || policy.implies(RequestPolicy.REACHABLE_COMMIT)) adv.advertiseCapability(OPTION_ALLOW_REACHABLE_SHA1_IN_WANT); adv.advertiseCapability(OPTION_AGENT, UserAgent.get()); if (transferConfig.isAllowFilter()) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java index 8d89107..b7bb0cb 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java
@@ -16,13 +16,16 @@ import java.io.FileOutputStream; import java.io.IOException; import java.text.MessageFormat; +import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Collection; +import java.util.Deque; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import org.eclipse.jgit.errors.CompoundException; @@ -112,16 +115,16 @@ class WalkFetchConnection extends BaseFetchConnection { private final DateRevQueue localCommitQueue; /** Objects we need to copy from the remote repository. */ - private LinkedList<ObjectId> workQueue; + private Deque<ObjectId> workQueue; /** Databases we have not yet obtained the list of packs from. */ - private final LinkedList<WalkRemoteObjectDatabase> noPacksYet; + private final Deque<WalkRemoteObjectDatabase> noPacksYet; /** Databases we have not yet obtained the alternates from. */ - private final LinkedList<WalkRemoteObjectDatabase> noAlternatesYet; + private final Deque<WalkRemoteObjectDatabase> noAlternatesYet; /** Packs we have discovered, but have not yet fetched locally. */ - private final LinkedList<RemotePack> unfetchedPacks; + private final Map<String, RemotePack> unfetchedPacks; /** * Packs whose indexes we have looked at in {@link #unfetchedPacks}. @@ -163,13 +166,13 @@ class WalkFetchConnection extends BaseFetchConnection { remotes = new ArrayList<>(); remotes.add(w); - unfetchedPacks = new LinkedList<>(); + unfetchedPacks = new LinkedHashMap<>(); packsConsidered = new HashSet<>(); - noPacksYet = new LinkedList<>(); + noPacksYet = new ArrayDeque<>(); noPacksYet.add(w); - noAlternatesYet = new LinkedList<>(); + noAlternatesYet = new ArrayDeque<>(); noAlternatesYet.add(w); fetchErrors = new HashMap<>(); @@ -183,7 +186,7 @@ class WalkFetchConnection extends BaseFetchConnection { LOCALLY_SEEN = revWalk.newFlag("LOCALLY_SEEN"); //$NON-NLS-1$ localCommitQueue = new DateRevQueue(); - workQueue = new LinkedList<>(); + workQueue = new ArrayDeque<>(); } @Override @@ -226,7 +229,7 @@ public void setPackLockMessage(String message) { public void close() { inserter.close(); reader.close(); - for (RemotePack p : unfetchedPacks) { + for (RemotePack p : unfetchedPacks.values()) { if (p.tmpIdx != null) p.tmpIdx.delete(); } @@ -421,8 +424,9 @@ private void downloadObject(ProgressMonitor pm, AnyObjectId id) if (packNameList == null || packNameList.isEmpty()) continue; for (String packName : packNameList) { - if (packsConsidered.add(packName)) - unfetchedPacks.add(new RemotePack(wrr, packName)); + if (packsConsidered.add(packName)) { + unfetchedPacks.put(packName, new RemotePack(wrr, packName)); + } } if (downloadPackedObject(pm, id)) return; @@ -465,15 +469,27 @@ private boolean alreadyHave(AnyObjectId id) throws TransportException { } } + private boolean downloadPackedObject(ProgressMonitor monitor, + AnyObjectId id) throws TransportException { + Set<String> brokenPacks = new HashSet<>(); + try { + return downloadPackedObject(monitor, id, brokenPacks); + } finally { + brokenPacks.forEach(unfetchedPacks::remove); + } + } + @SuppressWarnings("Finally") private boolean downloadPackedObject(final ProgressMonitor monitor, - final AnyObjectId id) throws TransportException { + final AnyObjectId id, Set<String> brokenPacks) throws TransportException { // Search for the object in a remote pack whose index we have, // but whose pack we do not yet have. // - final Iterator<RemotePack> packItr = unfetchedPacks.iterator(); - while (packItr.hasNext() && !monitor.isCancelled()) { - final RemotePack pack = packItr.next(); + for (Entry<String, RemotePack> entry : unfetchedPacks.entrySet()) { + if (monitor.isCancelled()) { + break; + } + final RemotePack pack = entry.getValue(); try { pack.openIndex(monitor); } catch (IOException err) { @@ -483,7 +499,7 @@ private boolean downloadPackedObject(final ProgressMonitor monitor, // another source, so don't consider it a failure. // recordError(id, err); - packItr.remove(); + brokenPacks.add(entry.getKey()); continue; } @@ -534,7 +550,7 @@ private boolean downloadPackedObject(final ProgressMonitor monitor, } throw new TransportException(e.getMessage(), e); } - packItr.remove(); + brokenPacks.add(entry.getKey()); } if (!alreadyHave(id)) { @@ -549,11 +565,9 @@ private boolean downloadPackedObject(final ProgressMonitor monitor, // Complete any other objects that we can. // - final Iterator<ObjectId> pending = swapFetchQueue(); - while (pending.hasNext()) { - final ObjectId p = pending.next(); + final Deque<ObjectId> pending = swapFetchQueue(); + for (ObjectId p : pending) { if (pack.index.hasObject(p)) { - pending.remove(); process(p); } else { workQueue.add(p); @@ -565,9 +579,9 @@ private boolean downloadPackedObject(final ProgressMonitor monitor, return false; } - private Iterator<ObjectId> swapFetchQueue() { - final Iterator<ObjectId> r = workQueue.iterator(); - workQueue = new LinkedList<>(); + private Deque<ObjectId> swapFetchQueue() { + final Deque<ObjectId> r = workQueue; + workQueue = new ArrayDeque<>(); return r; }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/JDKHttpConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/JDKHttpConnection.java index 8e9be1d..e20acad 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/JDKHttpConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/JDKHttpConnection.java
@@ -20,7 +20,7 @@ import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -152,7 +152,7 @@ public List<String> getHeaderFields(@NonNull String name) { private static List<String> mapValuesToListIgnoreCase(String keyName, Map<String, List<String>> m) { - List<String> fields = new LinkedList<>(); + List<String> fields = new ArrayList<>(); m.entrySet().stream().filter(e -> keyName.equalsIgnoreCase(e.getKey())) .filter(e -> e.getValue() != null) .forEach(e -> fields.addAll(e.getValue()));
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java index aaac2a7..b789c51 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java
@@ -1587,6 +1587,9 @@ public String getSmudgeCommand(Attributes attributes) throws IOException { */ private String getFilterCommandDefinition(String filterDriverName, String filterCommandType) { + if (config == null) { + return null; + } String key = filterDriverName + "." + filterCommandType; //$NON-NLS-1$ String filterCommand = filterCommandsByNameDotType.get(key); if (filterCommand != null)
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/ByteArraySet.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/ByteArraySet.java index c941601..bcf79a2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/ByteArraySet.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/ByteArraySet.java
@@ -15,6 +15,10 @@ import org.eclipse.jgit.util.RawParseUtils; +import java.util.Arrays; +import java.util.Set; +import java.util.stream.Collectors; + /** * Specialized set for byte arrays, interpreted as strings for use in * {@link PathFilterGroup.Group}. Most methods assume the hash is already know @@ -291,4 +295,8 @@ public String toString() { return ret; } + Set<byte[]> toSet() { + return Arrays.stream(toArray()).collect(Collectors.toSet()); + } + }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java index 699ff6b..cfdc4dd 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java
@@ -10,8 +10,9 @@ package org.eclipse.jgit.treewalk.filter; import java.io.IOException; +import java.util.ArrayDeque; +import java.util.ArrayList; import java.util.HashSet; -import java.util.LinkedList; import java.util.List; import java.util.Set; @@ -62,9 +63,9 @@ public class IndexDiffFilter extends TreeFilter { private final Set<String> ignoredPaths = new HashSet<>(); - private final LinkedList<String> untrackedParentFolders = new LinkedList<>(); + private final ArrayDeque<String> untrackedParentFolders = new ArrayDeque<>(); - private final LinkedList<String> untrackedFolders = new LinkedList<>(); + private final ArrayDeque<String> untrackedFolders = new ArrayDeque<>(); /** * Creates a new instance of this filter. Do not use an instance of this @@ -272,12 +273,14 @@ public Set<String> getIgnoredPaths() { * empty list will be returned. */ public List<String> getUntrackedFolders() { - LinkedList<String> ret = new LinkedList<>(untrackedFolders); + ArrayList<String> ret = new ArrayList<>(untrackedFolders); if (!untrackedParentFolders.isEmpty()) { String toBeAdded = untrackedParentFolders.getLast(); - while (!ret.isEmpty() && ret.getLast().startsWith(toBeAdded)) - ret.removeLast(); - ret.addLast(toBeAdded); + while (!ret.isEmpty() + && ret.get(ret.size() - 1).startsWith(toBeAdded)) { + ret.remove(ret.size() - 1); + } + ret.add(toBeAdded); } return ret; }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilterGroup.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilterGroup.java index 5985557..4c0604a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilterGroup.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilterGroup.java
@@ -12,6 +12,8 @@ package org.eclipse.jgit.treewalk.filter; import java.util.Collection; +import java.util.Optional; +import java.util.Set; import org.eclipse.jgit.errors.StopWalkException; import org.eclipse.jgit.internal.JGitText; @@ -232,6 +234,15 @@ public boolean shouldBeRecursive() { } @Override + public Optional<Set<byte[]>> getPathsBestEffort() { + Set<byte[]> result = fullpaths.toSet(); + if (result.isEmpty()) { + return Optional.empty(); + } + return Optional.of(result); + } + + @Override public TreeFilter clone() { return this; }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/TreeFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/TreeFilter.java index 22d430b..a9066dc 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/TreeFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/TreeFilter.java
@@ -210,7 +210,7 @@ public int matchFilter(TreeWalk walker) throws MissingObjectException, public abstract boolean shouldBeRecursive(); /** - * If this filter checks that a specific set of paths have all been + * If this filter checks that at least one of the paths in a set has been * modified, returns that set of paths to be checked against a changed path * filter. Otherwise, returns empty. *
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java index d91f37b..e73095f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2010, Robin Rosenberg and others + * Copyright (C) 2010, 2024, Robin Rosenberg and others * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0 which is available at @@ -203,7 +203,16 @@ public boolean supportsExecute() { /** {@inheritDoc} */ @Override public boolean canExecute(File f) { - return FileUtils.canExecute(f); + if (!isFile(f)) { + return false; + } + try { + Path path = FileUtils.toPath(f); + Set<PosixFilePermission> pset = Files.getPosixFilePermissions(path); + return pset.contains(PosixFilePermission.OWNER_EXECUTE); + } catch (IOException ex) { + return false; + } } /** {@inheritDoc} */ @@ -250,8 +259,12 @@ private static void apply(Set<PosixFilePermission> set, /** {@inheritDoc} */ @Override public ProcessBuilder runInShell(String cmd, String[] args) { - List<String> argv = new ArrayList<>(4 + args.length); + List<String> argv = new ArrayList<>(5 + args.length); argv.add("sh"); //$NON-NLS-1$ + if (SystemReader.getInstance().isMacOS()) { + // Use a login shell to get the full normal $PATH + argv.add("-l"); //$NON-NLS-1$ + } argv.add("-c"); //$NON-NLS-1$ argv.add(cmd + " \"$@\""); //$NON-NLS-1$ argv.add(cmd);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/UnionInputStream.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/UnionInputStream.java index b37f28b..7e950f6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/UnionInputStream.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/UnionInputStream.java
@@ -12,8 +12,8 @@ import java.io.IOException; import java.io.InputStream; -import java.util.Iterator; -import java.util.LinkedList; +import java.util.ArrayDeque; +import java.util.Deque; /** * An InputStream which reads from one or more InputStreams. @@ -34,7 +34,7 @@ public int read() throws IOException { } }; - private final LinkedList<InputStream> streams = new LinkedList<>(); + private final Deque<InputStream> streams = new ArrayDeque<>(); /** * Create an empty InputStream that is currently at EOF state. @@ -163,14 +163,14 @@ public long skip(long count) throws IOException { public void close() throws IOException { IOException err = null; - for (Iterator<InputStream> i = streams.iterator(); i.hasNext();) { + for (InputStream stream : streams) { try { - i.next().close(); + stream.close(); } catch (IOException closeError) { err = closeError; } - i.remove(); } + streams.clear(); if (err != null) throw err;
diff --git a/pom.xml b/pom.xml index 3482c74..0762920 100644 --- a/pom.xml +++ b/pom.xml
@@ -18,7 +18,7 @@ <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> <packaging>pom</packaging> - <version>6.9.1-SNAPSHOT</version> + <version>6.10.2-SNAPSHOT</version> <name>JGit - Parent</name> <url>${jgit-url}</url> @@ -118,37 +118,37 @@ <project.build.outputTimestamp>${commit.time.iso}</project.build.outputTimestamp> - <jgit-last-release-version>6.8.0.202311291450-r</jgit-last-release-version> + <jgit-last-release-version>6.9.0.202403050737-r</jgit-last-release-version> <ant-version>1.10.14</ant-version> - <apache-sshd-version>2.12.0</apache-sshd-version> + <apache-sshd-version>2.14.0</apache-sshd-version> <jsch-version>0.1.55</jsch-version> <jzlib-version>1.1.3</jzlib-version> <javaewah-version>1.2.3</javaewah-version> <junit-version>4.13.2</junit-version> <test-fork-count>1C</test-fork-count> - <args4j-version>2.33</args4j-version> - <commons-compress-version>1.26.0</commons-compress-version> + <args4j-version>2.37</args4j-version> + <commons-compress-version>1.26.2</commons-compress-version> <osgi-core-version>6.0.0</osgi-core-version> <servlet-api-version>4.0.4</servlet-api-version> - <jetty-version>10.0.20</jetty-version> - <japicmp-version>0.18.5</japicmp-version> + <jetty-version>10.0.21</jetty-version> + <japicmp-version>0.21.2</japicmp-version> <httpclient-version>4.5.14</httpclient-version> <httpcore-version>4.4.16</httpcore-version> <slf4j-version>1.7.36</slf4j-version> <maven-javadoc-plugin-version>3.6.3</maven-javadoc-plugin-version> - <gson-version>2.10.1</gson-version> - <bouncycastle-version>1.77</bouncycastle-version> - <spotbugs-maven-plugin-version>4.8.3.1</spotbugs-maven-plugin-version> + <gson-version>2.11.0</gson-version> + <bouncycastle-version>1.78.1</bouncycastle-version> + <spotbugs-maven-plugin-version>4.8.5.0</spotbugs-maven-plugin-version> <maven-project-info-reports-plugin-version>3.5.1</maven-project-info-reports-plugin-version> <maven-jxr-plugin-version>3.3.2</maven-jxr-plugin-version> <maven-surefire-plugin-version>3.2.5</maven-surefire-plugin-version> <maven-surefire-report-plugin-version>${maven-surefire-plugin-version}</maven-surefire-report-plugin-version> - <maven-compiler-plugin-version>3.12.1</maven-compiler-plugin-version> + <maven-compiler-plugin-version>3.13.0</maven-compiler-plugin-version> <plexus-compiler-version>2.13.0</plexus-compiler-version> <hamcrest-version>2.2</hamcrest-version> - <assertj-version>3.25.3</assertj-version> + <assertj-version>3.26.0</assertj-version> <jna-version>5.14.0</jna-version> - <byte-buddy-version>1.14.12</byte-buddy-version> + <byte-buddy-version>1.14.16</byte-buddy-version> <!-- Properties to enable jacoco code coverage analysis --> <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> @@ -184,7 +184,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> - <version>3.3.0</version> + <version>3.4.1</version> <configuration> <archive> <manifestEntries> @@ -214,7 +214,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> - <version>3.5.1</version> + <version>3.5.3</version> </plugin> <plugin> @@ -232,7 +232,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> - <version>3.3.0</version> + <version>3.3.1</version> </plugin> <plugin> @@ -255,7 +255,7 @@ <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> - <version>3.5.0</version> + <version>3.6.0</version> </plugin> <plugin> @@ -277,7 +277,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> - <version>3.21.2</version> + <version>3.22.0</version> <configuration> <inputEncoding>${project.build.sourceEncoding}</inputEncoding> <minimumTokens>100</minimumTokens> @@ -305,12 +305,12 @@ <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> - <version>0.8.11</version> + <version>0.8.12</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> - <version>4.0.0-M13</version> + <version>4.0.0-M14</version> <dependencies> <dependency><!-- add support for ssh/scp --> <groupId>org.apache.maven.wagon</groupId> @@ -337,12 +337,12 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> - <version>3.1.1</version> + <version>3.1.2</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-install-plugin</artifactId> - <version>3.1.1</version> + <version>3.1.2</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -357,7 +357,7 @@ <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> - <version>2.7.13</version> + <version>2.7.18</version> </plugin> <plugin> <groupId>org.eclipse.dash</groupId> @@ -367,12 +367,12 @@ <plugin> <groupId>org.cyclonedx</groupId> <artifactId>cyclonedx-maven-plugin</artifactId> - <version>2.7.10</version> + <version>2.8.0</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-artifact-plugin</artifactId> - <version>3.5.0</version> + <version>3.5.1</version> <configuration> <ignore>**/*cyclonedx.json</ignore> <reproducible>true</reproducible> @@ -636,7 +636,7 @@ <plugin> <groupId>io.github.git-commit-id</groupId> <artifactId>git-commit-id-maven-plugin</artifactId> - <version>7.0.0</version> + <version>8.0.2</version> <executions> <execution> <id>get-the-git-infos</id> @@ -660,13 +660,13 @@ <dependency> <groupId>org.apache.groovy</groupId> <artifactId>groovy</artifactId> - <version>4.0.15</version> + <version>4.0.21</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.apache.groovy</groupId> <artifactId>groovy-ant</artifactId> - <version>4.0.15</version> + <version>4.0.21</version> <scope>runtime</scope> </dependency> </dependencies> @@ -897,12 +897,30 @@ </dependency> <dependency> + <groupId>commons-codec</groupId> + <artifactId>commons-codec</artifactId> + <version>1.17.0</version> + </dependency> + + <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-compress</artifactId> <version>${commons-compress-version}</version> </dependency> <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-io</artifactId> + <version>2.16.1</version> + </dependency> + + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.3.2</version> + </dependency> + + <dependency> <groupId>org.tukaani</groupId> <artifactId>xz</artifactId> <version>1.9</version> @@ -996,7 +1014,7 @@ <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> - <version>5.10.0</version> + <version>5.12.0</version> </dependency> <dependency> @@ -1105,7 +1123,7 @@ <dependency> <groupId>org.eclipse.jdt</groupId> <artifactId>ecj</artifactId> - <version>3.36.0</version> + <version>3.37.0</version> </dependency> </dependencies> </plugin>
diff --git a/tools/BUILD b/tools/BUILD index c2b2366..c7ec638 100644 --- a/tools/BUILD +++ b/tools/BUILD
@@ -17,7 +17,7 @@ default_java_toolchain( name = "error_prone_warnings_toolchain_java17", configuration = dict(), - java_runtime = "@bazel_tools//tools/jdk:remotejdk_17", + java_runtime = "@rules_java//toolchains:remotejdk_17", package_configuration = [ ":error_prone", ], @@ -26,6 +26,18 @@ visibility = ["//visibility:public"], ) +default_java_toolchain( + name = "error_prone_warnings_toolchain_java21", + configuration = dict(), + java_runtime = "@rules_java//toolchains:remotejdk_21", + package_configuration = [ + ":error_prone", + ], + source_version = "21", + target_version = "21", + visibility = ["//visibility:public"], +) + # Error Prone errors enabled by default; see ../.bazelrc for how this is # enabled. This warnings list is originally based on: # https://github.com/bazelbuild/BUILD_file_generator/blob/master/tools/bazel_defs/java.bzl @@ -62,7 +74,7 @@ "-Xep:AutoValueSubclassLeaked:WARN", "-Xep:BadAnnotationImplementation:ERROR", "-Xep:BadComparable:ERROR", - "-Xep:BadImport:WARN", + "-Xep:BadImport:ERROR", "-Xep:BadInstanceof:ERROR", "-Xep:BadShiftAmount:ERROR", "-Xep:BanSerializableRead:ERROR", @@ -75,8 +87,8 @@ "-Xep:CacheLoaderNull:ERROR", "-Xep:CannotMockFinalClass:ERROR", "-Xep:CanonicalDuration:ERROR", - "-Xep:CatchAndPrintStackTrace:WARN", - "-Xep:CatchFail:WARN", + "-Xep:CatchAndPrintStackTrace:ERROR", + "-Xep:CatchFail:ERROR", "-Xep:ChainedAssertionLosesContext:ERROR", "-Xep:ChainingConstructorIgnoresParameter:ERROR", "-Xep:CharacterGetNumericValue:ERROR", @@ -158,7 +170,7 @@ "-Xep:FromTemporalAccessor:ERROR", "-Xep:FunctionalInterfaceClash:ERROR", "-Xep:FunctionalInterfaceMethodChanged:ERROR", - "-Xep:FutureReturnValueIgnored:WARN", + "-Xep:FutureReturnValueIgnored:ERROR", "-Xep:FuturesGetCheckedIllegalExceptionType:ERROR", "-Xep:GetClassOnAnnotation:ERROR", "-Xep:GetClassOnClass:ERROR", @@ -222,7 +234,7 @@ "-Xep:JavaPeriodGetDays:ERROR", "-Xep:JavaTimeDefaultTimeZone:ERROR", "-Xep:JavaUtilDate:WARN", - "-Xep:JdkObsolete:WARN", + "-Xep:JdkObsolete:ERROR", "-Xep:JodaConstructors:ERROR", "-Xep:JodaDateTimeConstants:ERROR", "-Xep:JodaDurationWithMillis:ERROR", @@ -251,7 +263,7 @@ "-Xep:LockOnBoxedPrimitive:ERROR", "-Xep:LogicalAssignment:ERROR", "-Xep:LongFloatConversion:ERROR", - "-Xep:LongLiteralLowerCaseSuffix:WARN", + "-Xep:LongLiteralLowerCaseSuffix:ERROR", "-Xep:LoopConditionChecker:ERROR", "-Xep:LoopOverCharArray:ERROR", "-Xep:LossyPrimitiveCompare:ERROR", @@ -270,7 +282,7 @@ "-Xep:MixedDescriptors:ERROR", "-Xep:MixedMutabilityReturnType:WARN", "-Xep:MockitoUsage:ERROR", - "-Xep:ModifiedButNotUsed:WARN", + "-Xep:ModifiedButNotUsed:ERROR", "-Xep:ModifyCollectionInEnhancedForLoop:ERROR", "-Xep:ModifyingCollectionWithItself:ERROR", "-Xep:ModifySourceCollectionInStream:ERROR", @@ -323,7 +335,7 @@ "-Xep:PreferredInterfaceType:OFF", "-Xep:PrimitiveAtomicReference:ERROR", "-Xep:PrivateSecurityContractProtoAccess:ERROR", - "-Xep:ProtectedMembersInFinalClass:WARN", + "-Xep:ProtectedMembersInFinalClass:ERROR", "-Xep:ProtoBuilderReturnValueIgnored:ERROR", "-Xep:ProtocolBufferOrdinal:ERROR", "-Xep:ProtoDurationGetSecondsGetNano:ERROR", @@ -396,7 +408,7 @@ "-Xep:UnnecessaryLambda:ERROR", "-Xep:UnnecessaryMethodInvocationMatcher:ERROR", "-Xep:UnnecessaryMethodReference:ERROR", - "-Xep:UnnecessaryParentheses:WARN", + "-Xep:UnnecessaryParentheses:ERROR", "-Xep:UnnecessaryTypeArgument:ERROR", "-Xep:UnrecognisedJavadocTag:ERROR", "-Xep:UnsafeFinalization:ERROR", @@ -407,10 +419,10 @@ "-Xep:UnusedException:ERROR", "-Xep:UnusedMethod:WARN", "-Xep:UnusedNestedClass:ERROR", - "-Xep:UnusedVariable:WARN", + "-Xep:UnusedVariable:ERROR", "-Xep:URLEqualsHashCode:ERROR", "-Xep:UseBinds:ERROR", - "-Xep:UseCorrectAssertInTests:WARN", + "-Xep:UseCorrectAssertInTests:ERROR", "-Xep:VariableNameSameAsType:ERROR", "-Xep:VarTypeName:ERROR", "-Xep:WaitNotInLoop:ERROR",
diff --git a/tools/remote-bazelrc b/tools/remote-bazelrc index 0c558f8..f8aabd2 100644 --- a/tools/remote-bazelrc +++ b/tools/remote-bazelrc
@@ -30,12 +30,11 @@ # Set several flags related to specifying the platform, toolchain and java # properties. -build:remote --crosstool_top=@rbe_jdk11//cc:toolchain -build:remote --extra_toolchains=@rbe_jdk11//config:cc-toolchain -build:remote --extra_execution_platforms=@rbe_jdk11//config:platform -build:remote --host_platform=@rbe_jdk11//config:platform -build:remote --platforms=@rbe_jdk11//config:platform -build:remote --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 +build:remote --crosstool_top=@ubuntu2204_jdk17//cc:toolchain +build:remote --extra_toolchains=@ubuntu2204_jdk17//config:cc-toolchain +build:remote --extra_execution_platforms=@ubuntu2204_jdk17//config:platform +build:remote --host_platform=@ubuntu2204_jdk17//config:platform +build:remote --platforms=@ubuntu2204_jdk17//config:platform # Set various strategies so that all actions execute remotely. Mixing remote # and local execution will lead to errors unless the toolchain and remote