Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.buckconfig26
-rw-r--r--.buckversion1
-rw-r--r--.gitignore9
-rw-r--r--.mailmap1
-rw-r--r--BUCK18
-rw-r--r--BUILD25
-rw-r--r--WORKSPACE150
-rw-r--r--lib/BUCK134
-rw-r--r--lib/BUILD156
-rw-r--r--lib/jetty/BUCK56
-rw-r--r--org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs4
-rw-r--r--org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF13
-rw-r--r--org.eclipse.jgit.ant.test/pom.xml2
-rw-r--r--org.eclipse.jgit.ant/.settings/org.eclipse.jdt.core.prefs4
-rw-r--r--org.eclipse.jgit.ant/META-INF/MANIFEST.MF6
-rw-r--r--org.eclipse.jgit.ant/pom.xml2
-rw-r--r--org.eclipse.jgit.archive/.settings/org.eclipse.jdt.core.prefs4
-rw-r--r--org.eclipse.jgit.archive/BUCK13
-rw-r--r--org.eclipse.jgit.archive/BUILD16
-rw-r--r--org.eclipse.jgit.archive/META-INF/MANIFEST.MF13
-rw-r--r--org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF4
-rw-r--r--org.eclipse.jgit.archive/pom.xml2
-rw-r--r--org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ArchiveFormats.java2
-rw-r--r--org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/FormatActivator.java2
-rw-r--r--org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TarFormat.java24
-rw-r--r--org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/Tbz2Format.java18
-rw-r--r--org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TgzFormat.java18
-rw-r--r--org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TxzFormat.java18
-rw-r--r--org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java23
-rw-r--r--org.eclipse.jgit.http.apache/.settings/org.eclipse.jdt.core.prefs4
-rw-r--r--org.eclipse.jgit.http.apache/BUCK11
-rw-r--r--org.eclipse.jgit.http.apache/BUILD13
-rw-r--r--org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF11
-rw-r--r--org.eclipse.jgit.http.apache/pom.xml2
-rw-r--r--org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java31
-rw-r--r--org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnectionFactory.java2
-rw-r--r--org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/TemporaryBufferEntity.java5
-rw-r--r--org.eclipse.jgit.http.server/.settings/org.eclipse.jdt.core.prefs4
-rw-r--r--org.eclipse.jgit.http.server/BUCK10
-rw-r--r--org.eclipse.jgit.http.server/BUILD13
-rw-r--r--org.eclipse.jgit.http.server/META-INF/MANIFEST.MF26
-rw-r--r--org.eclipse.jgit.http.server/pom.xml2
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java3
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java4
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitServlet.java4
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoPacksServlet.java1
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java1
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/IsLocalFilter.java3
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/NoCacheFilter.java3
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java3
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/RepositoryFilter.java3
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartOutputStream.java1
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java4
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/TextFileServlet.java1
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java3
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaFilter.java7
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaServlet.java2
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/NoParameterFilterConfig.java6
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexGroupFilter.java3
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexPipeline.java2
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/ServletBinderImpl.java4
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/SuffixPipeline.java2
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/UrlPipeline.java7
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/AsIsFileService.java1
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultReceivePackFactory.java2
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultUploadPackFactory.java2
-rw-r--r--org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs4
-rw-r--r--org.eclipse.jgit.http.test/BUCK41
-rw-r--r--org.eclipse.jgit.http.test/BUILD42
-rw-r--r--org.eclipse.jgit.http.test/META-INF/MANIFEST.MF38
-rw-r--r--org.eclipse.jgit.http.test/pom.xml2
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AdvertiseErrorTest.java3
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AsIsServiceTest.java1
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultReceivePackFactoryTest.java1
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultUploadPackFactoryTest.java1
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java3
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java4
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/FileResolverTest.java10
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/GitServletResponseTests.java6
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HookMessageTest.java4
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java2
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/MeasurePackSizeTest.java4
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/ProtocolErrorTest.java2
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/RegexPipelineTest.java2
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SetAdditionalHeadersTest.java3
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java141
-rw-r--r--org.eclipse.jgit.junit.http/.settings/org.eclipse.jdt.core.prefs4
-rw-r--r--org.eclipse.jgit.junit.http/BUCK18
-rw-r--r--org.eclipse.jgit.junit.http/BUILD22
-rw-r--r--org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF21
-rw-r--r--org.eclipse.jgit.junit.http/pom.xml2
-rw-r--r--org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AccessEvent.java5
-rw-r--r--org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java4
-rw-r--r--org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/HttpTestCase.java8
-rw-r--r--org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/MockServletConfig.java8
-rw-r--r--org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java18
-rw-r--r--org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/SimpleHttpServer.java1
-rw-r--r--org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/TestRequestLog.java2
-rw-r--r--org.eclipse.jgit.junit/.settings/.api_filters35
-rw-r--r--org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs4
-rw-r--r--org.eclipse.jgit.junit/BUCK10
-rw-r--r--org.eclipse.jgit.junit/BUILD14
-rw-r--r--org.eclipse.jgit.junit/META-INF/MANIFEST.MF36
-rw-r--r--org.eclipse.jgit.junit/pom.xml2
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java41
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java2
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java4
-rw-r--r--org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs4
-rw-r--r--org.eclipse.jgit.lfs.server.test/BUCK34
-rw-r--r--org.eclipse.jgit.lfs.server.test/BUILD49
-rw-r--r--org.eclipse.jgit.lfs.server.test/META-INF/MANIFEST.MF12
-rw-r--r--org.eclipse.jgit.lfs.server.test/pom.xml2
-rw-r--r--org.eclipse.jgit.lfs.server/.settings/org.eclipse.jdt.core.prefs4
-rw-r--r--org.eclipse.jgit.lfs.server/BUCK22
-rw-r--r--org.eclipse.jgit.lfs.server/BUILD17
-rw-r--r--org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF31
-rw-r--r--org.eclipse.jgit.lfs.server/pom.xml2
-rw-r--r--org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/LfsProtocolServlet.java93
-rw-r--r--org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/TransferHandler.java13
-rw-r--r--org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsServlet.java5
-rw-r--r--org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectDownloadListener.java46
-rw-r--r--org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectUploadListener.java4
-rw-r--r--org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/S3Repository.java10
-rw-r--r--org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java12
-rw-r--r--org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs4
-rw-r--r--org.eclipse.jgit.lfs.test/BUCK30
-rw-r--r--org.eclipse.jgit.lfs.test/BUILD31
-rw-r--r--org.eclipse.jgit.lfs.test/META-INF/MANIFEST.MF20
-rw-r--r--org.eclipse.jgit.lfs.test/pom.xml2
-rw-r--r--org.eclipse.jgit.lfs.test/tst/org/eclipse/jgit/lfs/lib/LfsPointerFilterTest.java214
-rw-r--r--org.eclipse.jgit.lfs.test/tst/org/eclipse/jgit/lfs/lib/LongObjectIdTest.java4
-rw-r--r--org.eclipse.jgit.lfs/.settings/org.eclipse.jdt.core.prefs4
-rw-r--r--org.eclipse.jgit.lfs/BUCK17
-rw-r--r--org.eclipse.jgit.lfs/BUILD11
-rw-r--r--org.eclipse.jgit.lfs/META-INF/MANIFEST.MF25
-rw-r--r--org.eclipse.jgit.lfs/pom.xml2
-rw-r--r--org.eclipse.jgit.lfs/resources/org/eclipse/jgit/lfs/internal/LfsText.properties2
-rw-r--r--org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java6
-rw-r--r--org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPointer.java14
-rw-r--r--org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/errors/LfsUnauthorized.java68
-rw-r--r--org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java2
-rw-r--r--org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AnyLongObjectId.java3
-rw-r--r--org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/Constants.java21
-rw-r--r--org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/LfsPointerFilter.java (renamed from org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FileUtils7Test.java)90
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.feature/feature.xml2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/feature.xml2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/pom.xml2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.xml2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/pom.xml2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.lfs.feature/feature.xml2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.lfs.feature/pom.xml2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.xml6
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/pom.xml2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.xml2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/pom.xml2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/feature.xml2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/pom.xml2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.5.target2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.target2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml2
-rw-r--r--org.eclipse.jgit.packaging/org.eclipse.jgit.target/projects/jetty-9.3.9.tpd20
-rw-r--r--org.eclipse.jgit.packaging/pom.xml2
-rw-r--r--org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs4
-rw-r--r--org.eclipse.jgit.pgm.test/BUCK37
-rw-r--r--org.eclipse.jgit.pgm.test/BUILD40
-rw-r--r--org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF36
-rw-r--r--org.eclipse.jgit.pgm.test/pom.xml2
-rw-r--r--org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/lib/CLIRepositoryTestCase.java5
-rw-r--r--org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java3
-rw-r--r--org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java21
-rw-r--r--org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ConfigTest.java3
-rw-r--r--org.eclipse.jgit.pgm/.settings/org.eclipse.jdt.core.prefs4
-rw-r--r--org.eclipse.jgit.pgm/BUCK81
-rw-r--r--org.eclipse.jgit.pgm/BUILD38
-rw-r--r--org.eclipse.jgit.pgm/META-INF/MANIFEST.MF80
-rw-r--r--org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF4
-rw-r--r--org.eclipse.jgit.pgm/pom.xml2
-rw-r--r--org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Add.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Blame.java6
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java5
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Daemon.java12
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/DiffTree.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Gc.java8
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Glog.java1
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java9
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java3
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsTree.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java6
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/MergeBase.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevParse.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java4
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Rm.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java14
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java10
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/LfsStore.java3
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java10
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCommands.java3
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java14
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/internal/CLIText.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/CmdLineParser.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/PathTreeFilterHandler.java2
-rw-r--r--org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs4
-rw-r--r--org.eclipse.jgit.test/BUCK95
-rw-r--r--org.eclipse.jgit.test/BUILD61
-rw-r--r--org.eclipse.jgit.test/META-INF/MANIFEST.MF85
-rw-r--r--org.eclipse.jgit.test/exttst/org/eclipse/jgit/patch/EGitPatchHistoryTest.java6
-rw-r--r--org.eclipse.jgit.test/pom.xml6
-rw-r--r--org.eclipse.jgit.test/src/org/eclipse/jgit/lib/Sets.java2
-rw-r--r--org.eclipse.jgit.test/tests.bzl48
-rw-r--r--org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/util/sha1/shattered-1.pdfbin0 -> 422435 bytes
-rw-r--r--org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/util/sha1/shattered-2.pdfbin0 -> 422435 bytes
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java7
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ArchiveCommandTest.java13
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java3
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CloneCommandTest.java3
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java14
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/EolRepositoryTest.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/FetchAndPullCommandsRecurseSubmodulesTest.java361
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/FetchCommandTest.java9
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/GitConstructionTest.java10
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LogCommandTest.java6
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LsRemoteCommandTest.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/NameRevCommandTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PullCommandTest.java9
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PushCommandTest.java54
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java40
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RenameBranchCommandTest.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashApplyCommandTest.java18
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashCreateCommandTest.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashDropCommandTest.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/TreeWalkAttributeTest.java6
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffEntryTest.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RenameDetectorTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheCGitCompatabilityTest.java6
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCachePathEditTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/events/ConfigChangeEventTest.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/ManifestParserTest.java51
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/RepoCommandTest.java799
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollectorTest.java387
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsInserterTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsPackCompacterTest.java144
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/AbbreviationTest.java6
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ConcurrentRepackTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcBasicPackingTest.java119
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcConcurrentTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcDeleteEmptyRefsFoldersTest.java132
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcKeepFilesTest.java5
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcOrphanFilesTest.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPackRefsTest.java6
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcTestCase.java4
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ObjectDirectoryTest.java47
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java6
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackIndexTestCase.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackReverseIndexTest.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackWriterTest.java49
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryTest.java16
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefUpdateTest.java25
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/UnpackedObjectTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/WindowCacheGetTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/reftree/LocalDiskRefTreeDatabaseTest.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/reftree/RefTreeDatabaseTest.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/BranchTrackingStatusTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java15
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/IndexDiffSubmoduleTest.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/IndexDiffTest.java17
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectCheckerTest.java119
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdOwnerMapTest.java14
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdSubclassMapTest.java14
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdTest.java4
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RacyGitTests.java16
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefDatabaseConflictingNamesTest.java6
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryCacheTest.java33
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ThreadSafeProgressMonitorTest.java7
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ValidRefNameTest.java75
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/RecursiveMergerTest.java6
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/NLSTest.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/DefaultNoteMergerTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/NoteMapMergerTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/NoteMapTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revplot/AbstractPlotRendererTest.java4
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revplot/PlotCommitListTest.java32
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/DateRevQueueTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FIFORevQueueTest.java4
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/LIFORevQueueTest.java4
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitListTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevFlagSetTest.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevQueueTestCase.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkFollowFilterTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkPathFilter6012Test.java3
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkTestCase.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleAddTest.java34
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleInitTest.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleStatusTest.java6
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleSyncTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleUpdateTest.java3
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java13
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/HttpAuthTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/LongMapTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/NetRCTest.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/OpenSshConfigTest.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PackParserTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java23
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushOptionsTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushProcessTest.java8
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackAdvertiseRefsHookTest.java90
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/SpiTransport.java6
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TestProtocolTest.java8
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java41
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/WalkEncryptionTest.java28
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorJava7Test.java207
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java161
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/IndexDiffFilterTest.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/InterIndexDiffFilterTest.java1
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterLogicTest.java360
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathSuffixFilterTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/BlockListTest.java32
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/ChangeIdUtilTest.java17
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FileUtilsTest.java (renamed from org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FileUtilTest.java)71
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/ReadLinesTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RefListTest.java18
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RefMapTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/UnionInputStreamTest.java6
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/sha1/SHA1Test.java238
-rw-r--r--org.eclipse.jgit.ui/.settings/org.eclipse.jdt.core.prefs4
-rw-r--r--org.eclipse.jgit.ui/BUCK7
-rw-r--r--org.eclipse.jgit.ui/BUILD9
-rw-r--r--org.eclipse.jgit.ui/META-INF/MANIFEST.MF18
-rw-r--r--org.eclipse.jgit.ui/pom.xml2
-rw-r--r--org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java6
-rw-r--r--org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java2
-rw-r--r--org.eclipse.jgit/.settings/.api_filters71
-rw-r--r--org.eclipse.jgit/.settings/org.eclipse.jdt.core.prefs4
-rw-r--r--org.eclipse.jgit/BUCK21
-rw-r--r--org.eclipse.jgit/BUILD31
-rw-r--r--org.eclipse.jgit/META-INF/MANIFEST.MF88
-rw-r--r--org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF4
-rw-r--r--org.eclipse.jgit/about.html37
-rw-r--r--org.eclipse.jgit/pom.xml7
-rw-r--r--org.eclipse.jgit/resources/org/eclipse/jgit/gitrepo/internal/RepoText.properties1
-rw-r--r--org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties19
-rw-r--r--org.eclipse.jgit/resources/org/eclipse/jgit/util/sha1/SHA1.compress92
-rw-r--r--org.eclipse.jgit/resources/org/eclipse/jgit/util/sha1/SHA1.recompress192
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/AddNoteCommand.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java7
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyResult.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/ArchiveCommand.java47
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/BlameCommand.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java9
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutResult.java8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/CleanCommand.java11
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java27
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/CreateBranchCommand.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteBranchCommand.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteTagCommand.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/DescribeCommand.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/DiffCommand.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java107
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/GarbageCollectCommand.java32
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/Git.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/GitCommand.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/InitCommand.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/ListBranchCommand.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/ListNotesCommand.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/ListTagCommand.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/LogCommand.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/MergeResult.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/NameRevCommand.java12
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java39
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/PushCommand.java51
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java23
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/ReflogCommand.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/RemoveNoteCommand.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/RenameBranchCommand.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/ShowNoteCommand.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/StashApplyCommand.java11
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/StashDropCommand.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/StashListCommand.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/Status.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/StatusCommand.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleAddCommand.java10
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleInitCommand.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleStatusCommand.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleSyncCommand.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleUpdateCommand.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/errors/CheckoutConflictException.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesNode.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesRule.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java9
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffAlgorithm.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffConfig.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffEntry.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/HashedSequencePair.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/HistogramDiff.java9
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/LowLevelDiffAlgorithm.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/MyersDiff.java12
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java27
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityRenameDetector.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/Subsequence.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheBuilder.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheTree.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/errors/CancelledException.java62
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/errors/CompoundException.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/events/ListenerList.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/AbstractHead.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/FileNameMatcher.java14
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java10
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/LastHead.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/ManifestParser.java63
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java56
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/internal/RepoText.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/hooks/GitHook.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreNode.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/AbstractMatcher.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/IMatcher.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/LeadingAsteriskMatcher.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/NameMatcher.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/PathMatcher.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/TrailingAsteriskMatcher.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/WildCardMatcher.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/WildMatcher.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java17
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/LagCheck.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/ProposalRound.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/RemoteGitReplica.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/BeforeDfsPackIndexLoadedListener.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java10
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheConfig.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java150
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsInserter.java11
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java32
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjectRepresentation.java11
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java30
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackDescription.java46
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java12
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java129
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReaderOptions.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsRefDatabase.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsRepository.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/InMemoryRepository.java21
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BasePackBitmapIndex.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java7
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/CachedObjectDirectory.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/CheckoutEntryImpl.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/DeltaBaseCache.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java11
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java329
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GcLog.java175
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java39
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java43
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryInserter.java82
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java9
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndex.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV1.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV2.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java37
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ReflogEntryImpl.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ReflogReaderImpl.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ReflogWriter.java7
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/SimpleDataInput.java15
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/SimpleDataOutput.java14
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObjectCache.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCache.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCursor.java11
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WriteConfig.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/BaseSearch.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaCache.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaIndex.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java9
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaWindow.java16
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackExt.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java71
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapPreparer.java17
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/submodule/SubmoduleValidator.java184
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java10
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchingProgressMonitor.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/BitmapIndex.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java11
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java26
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigSnapshot.java16
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java7
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/CoreConfig.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/EmptyProgressMonitor.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/FileMode.java7
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/GitmoduleEntry.java86
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java29
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/MutableObjectId.java18
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/NullProgressMonitor.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectChecker.java150
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectId.java13
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdRef.java12
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdSubclassMap.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java35
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java14
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/RefComparator.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java142
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/SubmoduleConfig.java86
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/SymbolicRef.java8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ThreadSafeProgressMonitor.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/UserConfig.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/WorkQueue.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeAlgorithm.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeConfig.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeFormatter.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeMessageFormatter.java12
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeResult.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeStrategy.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/RecursiveMerger.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java16
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/nls/GlobalBundleCache.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/nls/NLS.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/notes/DefaultNoteMerger.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/notes/FanoutBucket.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/notes/LeafBucket.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteMap.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedFileHeader.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedHunkHeader.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/patch/FileHeader.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/patch/FormatError.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/patch/Patch.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotWalk.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/AbstractRevQueue.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BlockRevQueue.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DateRevQueue.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DepthWalk.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FIFORevQueue.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FooterKey.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/LIFORevQueue.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommit.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevFlag.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevFlagSet.java7
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java18
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalkUtils.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/RevFilter.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackConfig.java76
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/submodule/SubmoduleWalk.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/AbstractAdvertiseRefsHook.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/AdvertiseRefsHook.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/AdvertiseRefsHookChain.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseConnection.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseFetchConnection.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackConnection.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java9
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java144
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleFetchConnection.java11
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleWriter.java10
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/ChainingCredentialsProvider.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/Connection.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProviderUserInfo.java9
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/Daemon.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/DaemonService.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/DefaultSshSessionFactory.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java18
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchResult.java32
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/HMACSHA1NonceGenerator.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java10
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/InternalFetchConnection.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/InternalPushConnection.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/JschSession.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/LongMap.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/NetRC.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/OpenSshConfig.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/OperationResult.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java29
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java70
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/PostReceiveHook.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/PostReceiveHookChain.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/PostUploadHook.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/PostUploadHookChain.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/PreReceiveHook.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/PreReceiveHookChain.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHook.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHookChain.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificateStore.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/PushProcess.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/RefFilter.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/RefLeaseSpec.java100
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/RefSpec.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java16
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/ServiceMayNotContinueException.java9
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/SignedPushConfig.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TestProtocol.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java91
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java11
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportBundleFile.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitAnon.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java18
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java45
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java19
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java25
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPackLogger.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPackLoggerChain.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkEncryption.java7
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java25
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java16
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/http/HttpConnection.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/http/JDKHttpConnection.java23
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/http/JDKHttpConnectionFactory.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/FileResolver.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/ReceivePackFactory.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/RepositoryResolver.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/UploadPackFactory.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/CanonicalTreeParser.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/NameConflictTreeWalk.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java59
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java21
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeOptions.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/AndTreeFilter.java39
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/NotTreeFilter.java18
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/OrTreeFilter.java39
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilter.java8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilterGroup.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/TreeFilter.java29
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/Base64.java14
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/BlockList.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/CachedAuthenticator.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java113
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java93
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java28
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/GitDateParser.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java27
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/IO.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/IntList.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/LongList.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/RawCharSequence.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/RefList.java16
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/RefMap.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/TemporaryBuffer.java7
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/io/InterruptTimer.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/io/TeeInputStream.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/io/ThrowingPrintWriter.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/io/UnionInputStream.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/sha1/SHA1.java601
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/sha1/Sha1CollisionException.java70
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/sha1/UbcCheck.java1040
-rw-r--r--pom.xml16
-rw-r--r--tools/BUILD0
-rw-r--r--tools/bazlets.bzl16
696 files changed, 11776 insertions, 3028 deletions
diff --git a/.buckconfig b/.buckconfig
deleted file mode 100644
index 798649407c..0000000000
--- a/.buckconfig
+++ /dev/null
@@ -1,26 +0,0 @@
-[alias]
- all = //:all
- jgit = //org.eclipse.jgit:jgit
- jgit-archive = //org.eclipse.jgit.archive:jgit-archive
- jgit_bin = //:jgit_bin
- jgit-lfs = //org.eclipse.jgit.lfs:jgit-lfs
- jgit-lfs-server = //org.eclipse.jgit.lfs.server:jgit-lfs-server
- jgit-servlet = //org.eclipse.jgit.http.server:jgit-servlet
-
-[buildfile]
- includes = //tools/default.defs
-
-[java]
- src_roots = src, resources, tst
- source_level = 8
- target_level = 8
-
-[project]
- ignore = .git
-
-[cache]
- mode = dir
-
-[download]
- maven_repo = http://repo1.maven.org/maven2
- in_build = true
diff --git a/.buckversion b/.buckversion
deleted file mode 100644
index 7eb591fec5..0000000000
--- a/.buckversion
+++ /dev/null
@@ -1 +0,0 @@
-e27df656657f93f8d57a7aaac69a5ae0e298a292
diff --git a/.gitignore b/.gitignore
index e78f8fd9b1..963b8a4420 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,9 @@
-/.buckd
/.project
-/buck-cache
-/buck-out
/target
infer-out
+bazel-bin
+bazel-genfiles
+bazel-jgit
+bazel-out
+bazel-testlogs
+*~
diff --git a/.mailmap b/.mailmap
index ab4c96336c..560baaa666 100644
--- a/.mailmap
+++ b/.mailmap
@@ -2,6 +2,7 @@ Mark Ingram <markdingram@gmail.com> markdingram <markdingram@gmail.com>
Roberto Tyley <roberto.tyley@guardian.co.uk> roberto <roberto.tyley@guardian.co.uk>
Saša Živkov <sasa.zivkov@sap.com> Sasa Zivkov <sasa.zivkov@sap.com>
Saša Živkov <sasa.zivkov@sap.com> Saša Živkov <zivkov@gmail.com>
+Saša Živkov <sasa.zivkov@sap.com> Sasa Zivkov <zivkov@gmail.com>
Shawn Pearce <spearce@spearce.org> Shawn O. Pearce <sop@google.com>
Shawn Pearce <spearce@spearce.org> Shawn Pearce <sop@google.com>
Shawn Pearce <spearce@spearce.org> Shawn O. Pearce <spearce@spearce.org>
diff --git a/BUCK b/BUCK
deleted file mode 100644
index 4578e17586..0000000000
--- a/BUCK
+++ /dev/null
@@ -1,18 +0,0 @@
-DEPS = [
- '//org.eclipse.jgit:jgit',
- '//org.eclipse.jgit.archive:jgit-archive',
- '//org.eclipse.jgit.http.server:jgit-servlet',
- '//org.eclipse.jgit.lfs:jgit-lfs',
- '//org.eclipse.jgit.lfs.server:jgit-lfs-server',
- '//org.eclipse.jgit.pgm:jgit',
-]
-
-zip_file(
- name = 'all',
- srcs = DEPS,
-)
-
-sh_binary(
- name = 'jgit_bin',
- main = '//org.eclipse.jgit.pgm:jgit',
-)
diff --git a/BUILD b/BUILD
new file mode 100644
index 0000000000..be6dd767d5
--- /dev/null
+++ b/BUILD
@@ -0,0 +1,25 @@
+package(default_visibility = ["//visibility:public"])
+
+genrule(
+ name = "all",
+ testonly = 1,
+ srcs = [
+ "//org.eclipse.jgit:jgit",
+ "//org.eclipse.jgit.pgm:pgm",
+ "//org.eclipse.jgit.ui:ui",
+ "//org.eclipse.jgit.archive:jgit-archive",
+ "//org.eclipse.jgit.http.apache:http-apache",
+ "//org.eclipse.jgit.http.server:jgit-servlet",
+ "//org.eclipse.jgit.lfs:jgit-lfs",
+ "//org.eclipse.jgit.lfs.server:jgit-lfs-server",
+ "//org.eclipse.jgit.junit:junit",
+ ],
+ outs = ["all.zip"],
+ cmd = " && ".join([
+ "p=$$PWD",
+ "t=$$(mktemp -d || mktemp -d -t bazel-tmp)",
+ "cp $(SRCS) $$t",
+ "cd $$t",
+ "zip -qr $$p/$@ .",
+ ]),
+)
diff --git a/WORKSPACE b/WORKSPACE
new file mode 100644
index 0000000000..c5eae1dffb
--- /dev/null
+++ b/WORKSPACE
@@ -0,0 +1,150 @@
+workspace(name = "jgit")
+
+load("//tools:bazlets.bzl", "load_bazlets")
+
+load_bazlets(commit = "3afbeab55ece585dbfc7a980bf7214b24ddbbe86")
+
+load(
+ "@com_googlesource_gerrit_bazlets//tools:maven_jar.bzl",
+ "maven_jar",
+)
+
+maven_jar(
+ name = "jsch",
+ artifact = "com.jcraft:jsch:0.1.53",
+ sha1 = "658b682d5c817b27ae795637dfec047c63d29935",
+)
+
+maven_jar(
+ name = "javaewah",
+ artifact = "com.googlecode.javaewah:JavaEWAH:1.1.6",
+ sha1 = "94ad16d728b374d65bd897625f3fbb3da223a2b6",
+)
+
+maven_jar(
+ name = "httpclient",
+ artifact = "org.apache.httpcomponents:httpclient:4.3.6",
+ sha1 = "4c47155e3e6c9a41a28db36680b828ced53b8af4",
+)
+
+maven_jar(
+ name = "httpcore",
+ artifact = "org.apache.httpcomponents:httpcore:4.3.3",
+ sha1 = "f91b7a4aadc5cf486df6e4634748d7dd7a73f06d",
+)
+
+maven_jar(
+ name = "commons-codec",
+ artifact = "commons-codec:commons-codec:1.4",
+ sha1 = "4216af16d38465bbab0f3dff8efa14204f7a399a",
+)
+
+maven_jar(
+ name = "commons-logging",
+ artifact = "commons-logging:commons-logging:1.1.3",
+ sha1 = "f6f66e966c70a83ffbdb6f17a0919eaf7c8aca7f",
+)
+
+maven_jar(
+ name = "log-api",
+ artifact = "org.slf4j:slf4j-api:1.7.2",
+ sha1 = "0081d61b7f33ebeab314e07de0cc596f8e858d97",
+)
+
+maven_jar(
+ name = "slf4j-simple",
+ artifact = "org.slf4j:slf4j-simple:1.7.2",
+ sha1 = "760055906d7353ba4f7ce1b8908bc6b2e91f39fa",
+)
+
+maven_jar(
+ name = "servlet-api-3_1",
+ artifact = "javax.servlet:javax.servlet-api:3.1.0",
+ sha1 = "3cd63d075497751784b2fa84be59432f4905bf7c",
+)
+
+maven_jar(
+ name = "commons-compress",
+ artifact = "org.apache.commons:commons-compress:1.6",
+ sha1 = "c7d9b580aff9e9f1998361f16578e63e5c064699",
+)
+
+maven_jar(
+ name = "tukaani-xz",
+ artifact = "org.tukaani:xz:1.3",
+ sha1 = "66db21c8484120cb6a51b5b3ea47b6f383942bec",
+)
+
+maven_jar(
+ name = "args4j",
+ artifact = "args4j:args4j:2.0.15",
+ sha1 = "139441471327b9cc6d56436cb2a31e60eb6ed2ba",
+)
+
+maven_jar(
+ name = "junit",
+ artifact = "junit:junit:4.11",
+ sha1 = "4e031bb61df09069aeb2bffb4019e7a5034a4ee0",
+)
+
+maven_jar(
+ name = "hamcrest-library",
+ artifact = "org.hamcrest:hamcrest-library:1.3",
+ sha1 = "4785a3c21320980282f9f33d0d1264a69040538f",
+)
+
+maven_jar(
+ name = "hamcrest-core",
+ artifact = "org.hamcrest:hamcrest-core:1.3",
+ sha1 = "42a25dc3219429f0e5d060061f71acb49bf010a0",
+)
+
+maven_jar(
+ name = "gson",
+ artifact = "com.google.code.gson:gson:2.2.4",
+ sha1 = "a60a5e993c98c864010053cb901b7eab25306568",
+)
+
+JETTY_VER = "9.3.17.v20170317"
+
+maven_jar(
+ name = "jetty-servlet",
+ artifact = "org.eclipse.jetty:jetty-servlet:" + JETTY_VER,
+ sha1 = "ed6986b0d0ca7b9b0f9015c9efb80442e3043a8e",
+ src_sha1 = "ee6b4784a00a92e5c1b6111033b7ae41ac6052a3",
+)
+
+maven_jar(
+ name = "jetty-security",
+ artifact = "org.eclipse.jetty:jetty-security:" + JETTY_VER,
+ sha1 = "ca52535569445682d42aaa97c7039442719a0507",
+ src_sha1 = "2ff9f4fb18b320fd5a0272a427bacc4d5fe7bc86",
+)
+
+maven_jar(
+ name = "jetty-server",
+ artifact = "org.eclipse.jetty:jetty-server:" + JETTY_VER,
+ sha1 = "194e9a02e6ba249ef4a3f4bd56b4993087992299",
+ src_sha1 = "0c9bd572f530c411592aefb71781ecca0b3719a9",
+)
+
+maven_jar(
+ name = "jetty-http",
+ artifact = "org.eclipse.jetty:jetty-http:" + JETTY_VER,
+ sha1 = "6c02d728e15d4868486254039c867a1ac3e4a52e",
+ src_sha1 = "3c0a2a82792f268631b4fefd77be9f126ec974b1",
+)
+
+maven_jar(
+ name = "jetty-io",
+ artifact = "org.eclipse.jetty:jetty-io:" + JETTY_VER,
+ sha1 = "756a8cd2a1cbfb84a94973b6332dd3eccd47c0cd",
+ src_sha1 = "a9afa99cccb19b441364fa805d027f457cbbb136",
+)
+
+maven_jar(
+ name = "jetty-util",
+ artifact = "org.eclipse.jetty:jetty-util:" + JETTY_VER,
+ sha1 = "b8512ab02819de01f0f5a5c6026163041f579beb",
+ src_sha1 = "96f8e3dcdc3660a5c91f19c46695daa70ac95625",
+)
diff --git a/lib/BUCK b/lib/BUCK
deleted file mode 100644
index d89af5d243..0000000000
--- a/lib/BUCK
+++ /dev/null
@@ -1,134 +0,0 @@
-maven_jar(
- name = 'jsch',
- bin_sha1 = '658b682d5c817b27ae795637dfec047c63d29935',
- src_sha1 = '791359d94d6edcace686a56d0727ee093a2f7c33',
- group = 'com.jcraft',
- artifact = 'jsch',
- version = '0.1.53',
-)
-
-maven_jar(
- name = 'javaewah',
- bin_sha1 = '94ad16d728b374d65bd897625f3fbb3da223a2b6',
- src_sha1 = 'ca2745e91c6a51f8e6809d1579bda36ad83f1f58',
- group = 'com.googlecode.javaewah',
- artifact = 'JavaEWAH',
- version = '1.1.6',
-)
-
-maven_jar(
- name = 'httpcomponents',
- bin_sha1 = '4c47155e3e6c9a41a28db36680b828ced53b8af4',
- src_sha1 = 'af4d76be0c46ee26b0d9d1d4a34d244a633cac84',
- group = 'org.apache.httpcomponents',
- artifact = 'httpclient',
- version = '4.3.6',
-)
-
-maven_jar(
- name = 'httpcore',
- bin_sha1 = 'f91b7a4aadc5cf486df6e4634748d7dd7a73f06d',
- src_sha1 = '1b0aa62a6a91e9fa00c16f0a4a2c874804ed3b1e',
- group = 'org.apache.httpcomponents',
- artifact = 'httpcore',
- version = '4.3.3',
-)
-
-maven_jar(
- name = 'commons-logging',
- bin_sha1 = 'f6f66e966c70a83ffbdb6f17a0919eaf7c8aca7f',
- src_sha1 = '28bb0405fddaf04f15058fbfbe01fe2780d7d3b6',
- group = 'commons-logging',
- artifact = 'commons-logging',
- version = '1.1.3',
-)
-
-maven_jar(
- name = 'slf4j-api',
- bin_sha1 = '0081d61b7f33ebeab314e07de0cc596f8e858d97',
- src_sha1 = '58d38f68d4a867d4552ae27960bb348d7eaa1297',
- group = 'org.slf4j',
- artifact = 'slf4j-api',
- version = '1.7.2',
-)
-
-maven_jar(
- name = 'slf4j-simple',
- bin_sha1 = '760055906d7353ba4f7ce1b8908bc6b2e91f39fa',
- src_sha1 = '09474919128b3a7fcf21a5f9c907f5251f234544',
- group = 'org.slf4j',
- artifact = 'slf4j-simple',
- version = '1.7.2',
-)
-
-maven_jar(
- name = 'servlet-api',
- bin_sha1 = '3cd63d075497751784b2fa84be59432f4905bf7c',
- src_sha1 = 'ab3976d4574c48d22dc1abf6a9e8bd0fdf928223',
- group = 'javax.servlet',
- artifact = 'javax.servlet-api',
- version = '3.1.0',
-)
-
-maven_jar(
- name = 'commons-compress',
- bin_sha1 = 'c7d9b580aff9e9f1998361f16578e63e5c064699',
- src_sha1 = '396b81bdfd0fb617178e1707ef64832215307c78',
- group = 'org.apache.commons',
- artifact = 'commons-compress',
- version = '1.6',
-)
-
-maven_jar(
- name = 'tukaani-xz',
- bin_sha1 = '66db21c8484120cb6a51b5b3ea47b6f383942bec',
- src_sha1 = '6396220725701d767c553902c41120d7bf38e9f5',
- group = 'org.tukaani',
- artifact = 'xz',
- version = '1.3',
-)
-
-maven_jar(
- name = 'args4j',
- bin_sha1 = '139441471327b9cc6d56436cb2a31e60eb6ed2ba',
- src_sha1 = '22631b78cc8f60a6918557e8cbdb33e90f63a77f',
- group = 'args4j',
- artifact = 'args4j',
- version = '2.0.15',
-)
-
-maven_jar(
- name = 'junit',
- bin_sha1 = '4e031bb61df09069aeb2bffb4019e7a5034a4ee0',
- src_sha1 = '28e0ad201304e4a4abf999ca0570b7cffc352c3c',
- group = 'junit',
- artifact = 'junit',
- version = '4.11',
-)
-
-maven_jar(
- name = 'hamcrest-library',
- bin_sha1 = '4785a3c21320980282f9f33d0d1264a69040538f',
- src_sha1 = '047a7ee46628ab7133129cd7cef1e92657bc275e',
- group = 'org.hamcrest',
- artifact = 'hamcrest-library',
- version = '1.3',
-)
-
-maven_jar(
- name = 'hamcrest-core',
- bin_sha1 = '42a25dc3219429f0e5d060061f71acb49bf010a0',
- src_sha1 = '1dc37250fbc78e23a65a67fbbaf71d2e9cbc3c0b',
- group = 'org.hamcrest',
- artifact = 'hamcrest-core',
- version = '1.3',
-)
-
-maven_jar(
- name = 'gson',
- bin_sha1 = 'a60a5e993c98c864010053cb901b7eab25306568',
- src_sha1 = 'a6dc5db8a12928e583bd3f23e72d3ab611ecd58f',
- group = 'com.google.code.gson',
- artifact = 'gson',
- version = '2.2.4',
-)
diff --git a/lib/BUILD b/lib/BUILD
new file mode 100644
index 0000000000..346e1fd4e6
--- /dev/null
+++ b/lib/BUILD
@@ -0,0 +1,156 @@
+java_library(
+ name = "args4j",
+ visibility = [
+ "//org.eclipse.jgit.pgm:__pkg__",
+ "//org.eclipse.jgit.pgm.test:__pkg__",
+ ],
+ exports = ["@args4j//jar"],
+)
+
+java_library(
+ name = "commons-compress",
+ visibility = [
+ "//org.eclipse.jgit.archive:__pkg__",
+ "//org.eclipse.jgit.pgm.test:__pkg__",
+ ],
+ exports = ["@commons-compress//jar"],
+)
+
+java_library(
+ name = "commons-codec",
+ exports = ["@commons-codec//jar"],
+)
+
+java_library(
+ name = "commons-logging",
+ testonly = 1,
+ visibility = ["//visibility:public"],
+ exports = ["@commons-logging//jar"],
+)
+
+java_library(
+ name = "gson",
+ visibility = ["//org.eclipse.jgit.lfs.server:__pkg__"],
+ exports = ["@gson//jar"],
+)
+
+java_library(
+ name = "httpclient",
+ visibility = [
+ "//org.eclipse.jgit.http.apache:__pkg__",
+ "//org.eclipse.jgit.lfs.server.test:__pkg__",
+ "//org.eclipse.jgit.pgm:__pkg__",
+ ],
+ exports = ["@httpclient//jar"],
+)
+
+java_library(
+ name = "httpcore",
+ visibility = [
+ "//org.eclipse.jgit.http.apache:__pkg__",
+ "//org.eclipse.jgit.lfs.server:__pkg__",
+ "//org.eclipse.jgit.lfs.server.test:__pkg__",
+ "//org.eclipse.jgit.pgm:__pkg__",
+ ],
+ exports = ["@httpcore//jar"],
+)
+
+java_library(
+ name = "javaewah",
+ visibility = ["//visibility:public"],
+ exports = ["@javaewah//jar"],
+)
+
+java_library(
+ name = "jetty-http",
+ # TODO: This should be testonly but org.eclipse.jgit.pgm depends on it.
+ visibility = ["//visibility:public"],
+ exports = ["@jetty-http//jar"],
+ runtime_deps = [":commons-codec"],
+)
+
+java_library(
+ name = "jetty-io",
+ # TODO: This should be testonly but org.eclipse.jgit.pgm depends on it.
+ visibility = ["//visibility:public"],
+ exports = ["@jetty-io//jar"],
+)
+
+java_library(
+ name = "jetty-security",
+ # TODO: This should be testonly but org.eclipse.jgit.pgm depends on it.
+ visibility = ["//visibility:public"],
+ exports = ["@jetty-security//jar"],
+)
+
+java_library(
+ name = "jetty-server",
+ # TODO: This should be testonly but org.eclipse.jgit.pgm depends on it.
+ visibility = ["//visibility:public"],
+ exports = ["@jetty-server//jar"],
+)
+
+java_library(
+ name = "jetty-servlet",
+ # TODO: This should be testonly but org.eclipse.jgit.pgm depends on it.
+ visibility = ["//visibility:public"],
+ exports = ["@jetty-servlet//jar"],
+)
+
+java_library(
+ name = "jetty-util",
+ # TODO: This should be testonly but org.eclipse.jgit.pgm depends on it.
+ visibility = ["//visibility:public"],
+ exports = ["@jetty-util//jar"],
+)
+
+java_library(
+ name = "jsch",
+ visibility = ["//org.eclipse.jgit:__pkg__"],
+ exports = ["@jsch//jar"],
+)
+
+java_library(
+ name = "junit",
+ testonly = 1,
+ visibility = ["//visibility:public"],
+ exports = [
+ "@hamcrest-core//jar",
+ "@hamcrest-library//jar",
+ "@junit//jar",
+ ],
+)
+
+java_library(
+ name = "servlet-api",
+ visibility = [
+ "//org.eclipse.jgit.http.apache:__pkg__",
+ "//org.eclipse.jgit.http.server:__pkg__",
+ "//org.eclipse.jgit.http.test:__pkg__",
+ "//org.eclipse.jgit.junit.http:__pkg__",
+ "//org.eclipse.jgit.lfs.server:__pkg__",
+ "//org.eclipse.jgit.lfs.server.test:__pkg__",
+ "//org.eclipse.jgit.pgm:__pkg__",
+ ],
+ exports = ["@servlet-api-3_1//jar"],
+)
+
+java_library(
+ name = "slf4j-api",
+ visibility = ["//visibility:public"],
+ exports = ["@log-api//jar"],
+)
+
+java_library(
+ name = "slf4j-simple",
+ testonly = 1,
+ visibility = ["//visibility:public"],
+ exports = ["@slf4j-simple//jar"],
+)
+
+java_library(
+ name = "xz",
+ testonly = 1,
+ visibility = ["//visibility:public"],
+ exports = ["@tukaani-xz//jar"],
+)
diff --git a/lib/jetty/BUCK b/lib/jetty/BUCK
deleted file mode 100644
index fbb37c1e6a..0000000000
--- a/lib/jetty/BUCK
+++ /dev/null
@@ -1,56 +0,0 @@
-VERSION = '9.3.17.v20170317'
-GROUP = 'org.eclipse.jetty'
-
-maven_jar(
- name = 'servlet',
- bin_sha1 = 'ed6986b0d0ca7b9b0f9015c9efb80442e3043a8e',
- src_sha1 = 'ee6b4784a00a92e5c1b6111033b7ae41ac6052a3',
- group = GROUP,
- artifact = 'jetty-servlet',
- version = VERSION,
-)
-
-maven_jar(
- name = 'security',
- bin_sha1 = 'ca52535569445682d42aaa97c7039442719a0507',
- src_sha1 = '2ff9f4fb18b320fd5a0272a427bacc4d5fe7bc86',
- group = GROUP,
- artifact = 'jetty-security',
- version = VERSION,
-)
-
-maven_jar(
- name = 'server',
- bin_sha1 = '194e9a02e6ba249ef4a3f4bd56b4993087992299',
- src_sha1 = '0c9bd572f530c411592aefb71781ecca0b3719a9',
- group = GROUP,
- artifact = 'jetty-server',
- version = VERSION,
-)
-
-maven_jar(
- name = 'http',
- bin_sha1 = '6c02d728e15d4868486254039c867a1ac3e4a52e',
- src_sha1 = '3c0a2a82792f268631b4fefd77be9f126ec974b1',
- group = GROUP,
- artifact = 'jetty-http',
- version = VERSION,
-)
-
-maven_jar(
- name = 'io',
- bin_sha1 = '756a8cd2a1cbfb84a94973b6332dd3eccd47c0cd',
- src_sha1 = 'a9afa99cccb19b441364fa805d027f457cbbb136',
- group = GROUP,
- artifact = 'jetty-io',
- version = VERSION,
-)
-
-maven_jar(
- name = 'util',
- bin_sha1 = 'b8512ab02819de01f0f5a5c6026163041f579beb',
- src_sha1 = '96f8e3dcdc3660a5c91f19c46695daa70ac95625',
- group = GROUP,
- artifact = 'jetty-util',
- version = VERSION,
-)
diff --git a/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs
index 10c29d5576..64f74989e1 100644
--- a/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs
@@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -76,7 +76,7 @@ org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
diff --git a/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF
index 3bf69c36a9..681a0fa8a7 100644
--- a/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF
@@ -3,14 +3,13 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin_name
Bundle-SymbolicName: org.eclipse.jgit.ant.test
-Bundle-Version: 4.6.2.qualifier
+Bundle-Version: 4.7.8.qualifier
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: org.apache.tools.ant,
- org.eclipse.jgit.ant.tasks;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.internal.storage.file;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.junit;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lib;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.util;version="[4.6.2,4.7.0)",
- org.hamcrest;version="[1.1.0,2.0.0)",
+ org.eclipse.jgit.ant.tasks;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.junit;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lib;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.util;version="[4.7.8,4.8.0)",
+ org.hamcrest.core;version="[1.1.0,2.0.0)",
org.junit;version="[4.0.0,5.0.0)"
diff --git a/org.eclipse.jgit.ant.test/pom.xml b/org.eclipse.jgit.ant.test/pom.xml
index 9592841b2b..f74bafbdff 100644
--- a/org.eclipse.jgit.ant.test/pom.xml
+++ b/org.eclipse.jgit.ant.test/pom.xml
@@ -50,7 +50,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit-parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.jgit.ant.test</artifactId>
diff --git a/org.eclipse.jgit.ant/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.ant/.settings/org.eclipse.jdt.core.prefs
index 80cfbbbd3b..4d260cf480 100644
--- a/org.eclipse.jgit.ant/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.ant/.settings/org.eclipse.jdt.core.prefs
@@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -76,7 +76,7 @@ org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
diff --git a/org.eclipse.jgit.ant/META-INF/MANIFEST.MF b/org.eclipse.jgit.ant/META-INF/MANIFEST.MF
index 6b008e16e3..131fb09d91 100644
--- a/org.eclipse.jgit.ant/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.ant/META-INF/MANIFEST.MF
@@ -2,11 +2,11 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.jgit.ant
-Bundle-Version: 4.6.2.qualifier
+Bundle-Version: 4.7.8.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: org.apache.tools.ant,
- org.eclipse.jgit.storage.file;version="[4.6.2,4.7.0)"
+ org.eclipse.jgit.storage.file;version="[4.7.8,4.8.0)"
Bundle-Localization: plugin
Bundle-Vendor: %Provider-Name
-Export-Package: org.eclipse.jgit.ant.tasks;version="4.6.2";
+Export-Package: org.eclipse.jgit.ant.tasks;version="4.7.8";
uses:="org.apache.tools.ant.types,org.apache.tools.ant"
diff --git a/org.eclipse.jgit.ant/pom.xml b/org.eclipse.jgit.ant/pom.xml
index 194c9dde27..535f56cd98 100644
--- a/org.eclipse.jgit.ant/pom.xml
+++ b/org.eclipse.jgit.ant/pom.xml
@@ -48,7 +48,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit-parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.jgit.ant</artifactId>
diff --git a/org.eclipse.jgit.archive/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.archive/.settings/org.eclipse.jdt.core.prefs
index 4f1759fb3f..06ddbabb48 100644
--- a/org.eclipse.jgit.archive/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.archive/.settings/org.eclipse.jdt.core.prefs
@@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -76,7 +76,7 @@ org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
diff --git a/org.eclipse.jgit.archive/BUCK b/org.eclipse.jgit.archive/BUCK
deleted file mode 100644
index ae170324e3..0000000000
--- a/org.eclipse.jgit.archive/BUCK
+++ /dev/null
@@ -1,13 +0,0 @@
-java_library(
- name = 'jgit-archive',
- srcs = glob(
- ['src/**'],
- excludes = ['src/org/eclipse/jgit/archive/FormatActivator.java'],
- ),
- resources = glob(['resources/**']),
- provided_deps = [
- '//org.eclipse.jgit:jgit',
- '//lib:commons-compress',
- ],
- visibility = ['PUBLIC'],
-)
diff --git a/org.eclipse.jgit.archive/BUILD b/org.eclipse.jgit.archive/BUILD
new file mode 100644
index 0000000000..dfdbfdccba
--- /dev/null
+++ b/org.eclipse.jgit.archive/BUILD
@@ -0,0 +1,16 @@
+package(default_visibility = ["//visibility:public"])
+
+java_library(
+ name = "jgit-archive",
+ srcs = glob(
+ ["src/**"],
+ exclude = ["src/org/eclipse/jgit/archive/FormatActivator.java"],
+ ),
+ resource_strip_prefix = "org.eclipse.jgit.archive/resources",
+ resources = glob(["resources/**"]),
+ deps = [
+ "//lib:commons-compress",
+ # 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 b2fe6b2659..f9a55f8931 100644
--- a/org.eclipse.jgit.archive/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.archive/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin_name
Bundle-SymbolicName: org.eclipse.jgit.archive
-Bundle-Version: 4.6.2.qualifier
+Bundle-Version: 4.7.8.qualifier
Bundle-Vendor: %provider_name
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
@@ -12,14 +12,15 @@ Import-Package: org.apache.commons.compress.archivers;version="[1.4,2.0)",
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="[4.6.2,4.7.0)",
- org.eclipse.jgit.lib;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.nls;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.util;version="[4.6.2,4.7.0)",
+ org.eclipse.jgit.api;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lib;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.nls;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.revwalk;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.util;version="[4.7.8,4.8.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="4.6.2";
+Export-Package: org.eclipse.jgit.archive;version="4.7.8";
uses:="org.eclipse.jgit.lib,
org.eclipse.jgit.api,
org.apache.commons.compress.archivers,
diff --git a/org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF
index 7d7477c4b3..39be331049 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-ManifestVersion: 2
Bundle-Name: org.eclipse.jgit.archive - Sources
Bundle-SymbolicName: org.eclipse.jgit.archive.source
Bundle-Vendor: Eclipse.org - JGit
-Bundle-Version: 4.6.2.qualifier
-Eclipse-SourceBundle: org.eclipse.jgit.archive;version="4.6.2.qualifier";roots="."
+Bundle-Version: 4.7.8.qualifier
+Eclipse-SourceBundle: org.eclipse.jgit.archive;version="4.7.8.qualifier";roots="."
diff --git a/org.eclipse.jgit.archive/pom.xml b/org.eclipse.jgit.archive/pom.xml
index 9c3881758f..01259d459c 100644
--- a/org.eclipse.jgit.archive/pom.xml
+++ b/org.eclipse.jgit.archive/pom.xml
@@ -50,7 +50,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit-parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.jgit.archive</artifactId>
diff --git a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ArchiveFormats.java b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ArchiveFormats.java
index 1be126aa8a..9d3decd933 100644
--- a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ArchiveFormats.java
+++ b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ArchiveFormats.java
@@ -55,7 +55,7 @@ import org.eclipse.jgit.api.ArchiveCommand;
* that performs the same registration automatically.
*/
public class ArchiveFormats {
- private static final List<String> myFormats = new ArrayList<String>();
+ private static final List<String> myFormats = new ArrayList<>();
private static final void register(String name, ArchiveCommand.Format<?> fmt) {
myFormats.add(name);
diff --git a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/FormatActivator.java b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/FormatActivator.java
index a6a954f78c..aa4e4f5006 100644
--- a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/FormatActivator.java
+++ b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/FormatActivator.java
@@ -64,6 +64,7 @@ public class FormatActivator implements BundleActivator {
* @param context
* unused
*/
+ @Override
public void start(BundleContext context) {
ArchiveFormats.registerAll();
}
@@ -75,6 +76,7 @@ public class FormatActivator implements BundleActivator {
* @param context
* unused
*/
+ @Override
public void stop(BundleContext context) {
ArchiveFormats.unregisterAll();
}
diff --git a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TarFormat.java b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TarFormat.java
index d56cb35d9d..7b7fbcd83e 100644
--- a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TarFormat.java
+++ b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TarFormat.java
@@ -57,7 +57,10 @@ import org.apache.commons.compress.archivers.tar.TarConstants;
import org.eclipse.jgit.api.ArchiveCommand;
import org.eclipse.jgit.archive.internal.ArchiveText;
import org.eclipse.jgit.lib.FileMode;
+import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectLoader;
+import org.eclipse.jgit.revwalk.RevCommit;
+
/**
* Unix TAR format (ustar + some PAX extensions).
@@ -67,6 +70,7 @@ public final class TarFormat extends BaseFormat implements
private static final List<String> SUFFIXES = Collections
.unmodifiableList(Arrays.asList(".tar")); //$NON-NLS-1$
+ @Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
throws IOException {
return createArchiveOutputStream(s,
@@ -76,6 +80,7 @@ public final class TarFormat extends BaseFormat implements
/**
* @since 4.0
*/
+ @Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
Map<String, Object> o) throws IOException {
TarArchiveOutputStream out = new TarArchiveOutputStream(s, "UTF-8"); //$NON-NLS-1$
@@ -84,9 +89,21 @@ public final class TarFormat extends BaseFormat implements
return applyFormatOptions(out, o);
}
+ @Deprecated
+ @Override
public void putEntry(ArchiveOutputStream out,
String path, FileMode mode, ObjectLoader loader)
throws IOException {
+ putEntry(out, null, path, mode,loader);
+ }
+
+ /**
+ * @since 4.7
+ */
+ @Override
+ public void putEntry(ArchiveOutputStream out,
+ ObjectId tree, String path, FileMode mode, ObjectLoader loader)
+ throws IOException {
if (mode == FileMode.SYMLINK) {
final TarArchiveEntry entry = new TarArchiveEntry(
path, TarConstants.LF_SYMLINK);
@@ -106,6 +123,12 @@ public final class TarFormat extends BaseFormat implements
path = path + "/"; //$NON-NLS-1$
final TarArchiveEntry entry = new TarArchiveEntry(path);
+
+ if (tree instanceof RevCommit) {
+ long t = ((RevCommit) tree).getCommitTime() * 1000L;
+ entry.setModTime(t);
+ }
+
if (mode == FileMode.TREE) {
out.putArchiveEntry(entry);
out.closeArchiveEntry();
@@ -127,6 +150,7 @@ public final class TarFormat extends BaseFormat implements
out.closeArchiveEntry();
}
+ @Override
public Iterable<String> suffixes() {
return SUFFIXES;
}
diff --git a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/Tbz2Format.java b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/Tbz2Format.java
index f3ab4da43a..5f194ecdfc 100644
--- a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/Tbz2Format.java
+++ b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/Tbz2Format.java
@@ -53,6 +53,7 @@ import org.apache.commons.compress.archivers.ArchiveOutputStream;
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream;
import org.eclipse.jgit.api.ArchiveCommand;
import org.eclipse.jgit.lib.FileMode;
+import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectLoader;
/**
@@ -65,6 +66,7 @@ public final class Tbz2Format extends BaseFormat implements
private final ArchiveCommand.Format<ArchiveOutputStream> tarFormat = new TarFormat();
+ @Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
throws IOException {
return createArchiveOutputStream(s,
@@ -74,18 +76,32 @@ public final class Tbz2Format extends BaseFormat implements
/**
* @since 4.0
*/
+ @Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
Map<String, Object> o) throws IOException {
BZip2CompressorOutputStream out = new BZip2CompressorOutputStream(s);
return tarFormat.createArchiveOutputStream(out, o);
}
+ @Deprecated
+ @Override
public void putEntry(ArchiveOutputStream out,
String path, FileMode mode, ObjectLoader loader)
throws IOException {
- tarFormat.putEntry(out, path, mode, loader);
+ putEntry(out, null, path, mode,loader);
}
+ /**
+ * @since 4.7
+ */
+ @Override
+ public void putEntry(ArchiveOutputStream out,
+ ObjectId tree, String path, FileMode mode, ObjectLoader loader)
+ throws IOException {
+ tarFormat.putEntry(out, tree, path, mode, loader);
+ }
+
+ @Override
public Iterable<String> suffixes() {
return SUFFIXES;
}
diff --git a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TgzFormat.java b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TgzFormat.java
index 06f09a4887..a6d053e281 100644
--- a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TgzFormat.java
+++ b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TgzFormat.java
@@ -53,6 +53,7 @@ import org.apache.commons.compress.archivers.ArchiveOutputStream;
import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream;
import org.eclipse.jgit.api.ArchiveCommand;
import org.eclipse.jgit.lib.FileMode;
+import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectLoader;
/**
@@ -65,6 +66,7 @@ public final class TgzFormat extends BaseFormat implements
private final ArchiveCommand.Format<ArchiveOutputStream> tarFormat = new TarFormat();
+ @Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
throws IOException {
return createArchiveOutputStream(s,
@@ -74,18 +76,32 @@ public final class TgzFormat extends BaseFormat implements
/**
* @since 4.0
*/
+ @Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
Map<String, Object> o) throws IOException {
GzipCompressorOutputStream out = new GzipCompressorOutputStream(s);
return tarFormat.createArchiveOutputStream(out, o);
}
+ @Deprecated
+ @Override
public void putEntry(ArchiveOutputStream out,
String path, FileMode mode, ObjectLoader loader)
throws IOException {
- tarFormat.putEntry(out, path, mode, loader);
+ putEntry(out, null, path, mode,loader);
}
+ /**
+ * @since 4.7
+ */
+ @Override
+ public void putEntry(ArchiveOutputStream out,
+ ObjectId tree, String path, FileMode mode, ObjectLoader loader)
+ throws IOException {
+ tarFormat.putEntry(out, tree, path, mode, loader);
+ }
+
+ @Override
public Iterable<String> suffixes() {
return SUFFIXES;
}
diff --git a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TxzFormat.java b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TxzFormat.java
index 14839353d4..b6742acb98 100644
--- a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TxzFormat.java
+++ b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TxzFormat.java
@@ -53,6 +53,7 @@ import org.apache.commons.compress.archivers.ArchiveOutputStream;
import org.apache.commons.compress.compressors.xz.XZCompressorOutputStream;
import org.eclipse.jgit.api.ArchiveCommand;
import org.eclipse.jgit.lib.FileMode;
+import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectLoader;
/**
@@ -65,6 +66,7 @@ public final class TxzFormat extends BaseFormat implements
private final ArchiveCommand.Format<ArchiveOutputStream> tarFormat = new TarFormat();
+ @Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
throws IOException {
return createArchiveOutputStream(s,
@@ -74,18 +76,32 @@ public final class TxzFormat extends BaseFormat implements
/**
* @since 4.0
*/
+ @Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
Map<String, Object> o) throws IOException {
XZCompressorOutputStream out = new XZCompressorOutputStream(s);
return tarFormat.createArchiveOutputStream(out, o);
}
+ @Deprecated
+ @Override
public void putEntry(ArchiveOutputStream out,
String path, FileMode mode, ObjectLoader loader)
throws IOException {
- tarFormat.putEntry(out, path, mode, loader);
+ putEntry(out, null, path, mode,loader);
}
+ /**
+ * @since 4.7
+ */
+ @Override
+ public void putEntry(ArchiveOutputStream out,
+ ObjectId tree, String path, FileMode mode, ObjectLoader loader)
+ throws IOException {
+ tarFormat.putEntry(out, tree, path, mode, loader);
+ }
+
+ @Override
public Iterable<String> suffixes() {
return SUFFIXES;
}
diff --git a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java
index 0e1b2536f2..46d918ed70 100644
--- a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java
+++ b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java
@@ -56,7 +56,9 @@ import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
import org.eclipse.jgit.api.ArchiveCommand;
import org.eclipse.jgit.archive.internal.ArchiveText;
import org.eclipse.jgit.lib.FileMode;
+import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectLoader;
+import org.eclipse.jgit.revwalk.RevCommit;
/**
* PKWARE's ZIP format.
@@ -66,6 +68,7 @@ public final class ZipFormat extends BaseFormat implements
private static final List<String> SUFFIXES = Collections
.unmodifiableList(Arrays.asList(".zip")); //$NON-NLS-1$
+ @Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
throws IOException {
return createArchiveOutputStream(s,
@@ -75,14 +78,27 @@ public final class ZipFormat extends BaseFormat implements
/**
* @since 4.0
*/
+ @Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
Map<String, Object> o) throws IOException {
return applyFormatOptions(new ZipArchiveOutputStream(s), o);
}
+ @Deprecated
+ @Override
public void putEntry(ArchiveOutputStream out,
String path, FileMode mode, ObjectLoader loader)
throws IOException {
+ putEntry(out, null, path, mode,loader);
+ }
+
+ /**
+ * @since 4.7
+ */
+ @Override
+ public void putEntry(ArchiveOutputStream out,
+ ObjectId tree, String path, FileMode mode, ObjectLoader loader)
+ throws IOException {
// ZipArchiveEntry detects directories by checking
// for '/' at the end of the filename.
if (path.endsWith("/") && mode != FileMode.TREE) //$NON-NLS-1$
@@ -92,6 +108,12 @@ public final class ZipFormat extends BaseFormat implements
path = path + "/"; //$NON-NLS-1$
final ZipArchiveEntry entry = new ZipArchiveEntry(path);
+
+ if (tree instanceof RevCommit) {
+ long t = ((RevCommit) tree).getCommitTime() * 1000L;
+ entry.setTime(t);
+ }
+
if (mode == FileMode.TREE) {
out.putArchiveEntry(entry);
out.closeArchiveEntry();
@@ -114,6 +136,7 @@ public final class ZipFormat extends BaseFormat implements
out.closeArchiveEntry();
}
+ @Override
public Iterable<String> suffixes() {
return SUFFIXES;
}
diff --git a/org.eclipse.jgit.http.apache/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.http.apache/.settings/org.eclipse.jdt.core.prefs
index 80cfbbbd3b..4d260cf480 100644
--- a/org.eclipse.jgit.http.apache/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.http.apache/.settings/org.eclipse.jdt.core.prefs
@@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -76,7 +76,7 @@ org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
diff --git a/org.eclipse.jgit.http.apache/BUCK b/org.eclipse.jgit.http.apache/BUCK
deleted file mode 100644
index 3b7a8234f7..0000000000
--- a/org.eclipse.jgit.http.apache/BUCK
+++ /dev/null
@@ -1,11 +0,0 @@
-java_library(
- name = 'http-apache',
- srcs = glob(['src/**']),
- resources = glob(['resources/**']),
- deps = [
- '//org.eclipse.jgit:jgit',
- '//lib:httpcomponents',
- '//lib:httpcore',
- ],
- visibility = ['PUBLIC'],
-)
diff --git a/org.eclipse.jgit.http.apache/BUILD b/org.eclipse.jgit.http.apache/BUILD
new file mode 100644
index 0000000000..c1538ab1c6
--- /dev/null
+++ b/org.eclipse.jgit.http.apache/BUILD
@@ -0,0 +1,13 @@
+package(default_visibility = ["//visibility:public"])
+
+java_library(
+ name = "http-apache",
+ srcs = glob(["src/**"]),
+ resource_strip_prefix = "org.eclipse.jgit.http.apache/resources",
+ resources = glob(["resources/**"]),
+ deps = [
+ "//lib:httpclient",
+ "//lib:httpcore",
+ "//org.eclipse.jgit:jgit",
+ ],
+)
diff --git a/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF
index 978be2795b..21230211d9 100644
--- a/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.jgit.http.apache
-Bundle-Version: 4.6.2.qualifier
+Bundle-Version: 4.7.8.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Localization: plugin
Bundle-Vendor: %Provider-Name
@@ -20,13 +20,12 @@ Import-Package: org.apache.http;version="[4.3.0,5.0.0)",
org.apache.http.conn.ssl;version="[4.3.0,5.0.0)",
org.apache.http.entity;version="[4.3.0,5.0.0)",
org.apache.http.impl.client;version="[4.3.0,5.0.0)",
- org.apache.http.impl.client.cache;version="[4.3.0,5.0.0)",
org.apache.http.impl.conn;version="[4.3.0,5.0.0)",
org.apache.http.params;version="[4.3.0,5.0.0)",
- org.eclipse.jgit.nls;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.transport.http;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.util;version="[4.6.2,4.7.0)"
-Export-Package: org.eclipse.jgit.transport.http.apache;version="4.6.2";
+ org.eclipse.jgit.nls;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.transport.http;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.util;version="[4.7.8,4.8.0)"
+Export-Package: org.eclipse.jgit.transport.http.apache;version="4.7.8";
uses:="org.apache.http.client,
org.eclipse.jgit.transport.http,
org.apache.http.entity,
diff --git a/org.eclipse.jgit.http.apache/pom.xml b/org.eclipse.jgit.http.apache/pom.xml
index dfd8585b76..5cc886a3f8 100644
--- a/org.eclipse.jgit.http.apache/pom.xml
+++ b/org.eclipse.jgit.http.apache/pom.xml
@@ -48,7 +48,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit-parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-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 281154fb1a..945ecd5812 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
@@ -223,15 +223,18 @@ public class HttpClientConnection implements HttpConnection {
this.proxy = proxy;
}
+ @Override
public int getResponseCode() throws IOException {
execute();
return resp.getStatusLine().getStatusCode();
}
+ @Override
public URL getURL() {
return url;
}
+ @Override
public String getResponseMessage() throws IOException {
execute();
return resp.getStatusLine().getReasonPhrase();
@@ -259,10 +262,11 @@ public class HttpClientConnection implements HttpConnection {
}
}
+ @Override
public Map<String, List<String>> getHeaderFields() {
- Map<String, List<String>> ret = new HashMap<String, List<String>>();
+ Map<String, List<String>> ret = new HashMap<>();
for (Header hdr : resp.getAllHeaders()) {
- List<String> list = new LinkedList<String>();
+ List<String> list = new LinkedList<>();
for (HeaderElement hdrElem : hdr.getElements())
list.add(hdrElem.toString());
ret.put(hdr.getName(), list);
@@ -270,10 +274,12 @@ public class HttpClientConnection implements HttpConnection {
return ret;
}
+ @Override
public void setRequestProperty(String name, String value) {
req.addHeader(name, value);
}
+ @Override
public void setRequestMethod(String method) throws ProtocolException {
this.method = method;
if (METHOD_GET.equalsIgnoreCase(method)) {
@@ -290,18 +296,22 @@ public class HttpClientConnection implements HttpConnection {
}
}
+ @Override
public void setUseCaches(boolean usecaches) {
// not needed
}
+ @Override
public void setConnectTimeout(int timeout) {
this.timeout = Integer.valueOf(timeout);
}
+ @Override
public void setReadTimeout(int readTimeout) {
this.readTimeout = Integer.valueOf(readTimeout);
}
+ @Override
public String getContentType() {
HttpEntity responseEntity = resp.getEntity();
if (responseEntity != null) {
@@ -312,16 +322,19 @@ public class HttpClientConnection implements HttpConnection {
return null;
}
+ @Override
public InputStream getInputStream() throws IOException {
return resp.getEntity().getContent();
}
// will return only the first field
+ @Override
public String getHeaderField(String name) {
Header header = resp.getFirstHeader(name);
return (header == null) ? null : header.getValue();
}
+ @Override
public int getContentLength() {
Header contentLength = resp.getFirstHeader("content-length"); //$NON-NLS-1$
if (contentLength == null) {
@@ -336,14 +349,17 @@ public class HttpClientConnection implements HttpConnection {
}
}
+ @Override
public void setInstanceFollowRedirects(boolean followRedirects) {
this.followRedirects = Boolean.valueOf(followRedirects);
}
+ @Override
public void setDoOutput(boolean dooutput) {
// TODO: check whether we can really ignore this.
}
+ @Override
public void setFixedLengthStreamingMode(int contentLength) {
if (entity != null)
throw new IllegalArgumentException();
@@ -351,52 +367,63 @@ public class HttpClientConnection implements HttpConnection {
entity.setContentLength(contentLength);
}
+ @Override
public OutputStream getOutputStream() throws IOException {
if (entity == null)
entity = new TemporaryBufferEntity(new LocalFile(null));
return entity.getBuffer();
}
+ @Override
public void setChunkedStreamingMode(int chunklen) {
if (entity == null)
entity = new TemporaryBufferEntity(new LocalFile(null));
entity.setChunked(true);
}
+ @Override
public String getRequestMethod() {
return method;
}
+ @Override
public boolean usingProxy() {
return isUsingProxy;
}
+ @Override
public void connect() throws IOException {
execute();
}
+ @Override
public void setHostnameVerifier(final HostnameVerifier hostnameverifier) {
this.hostnameverifier = new X509HostnameVerifier() {
+ @Override
public boolean verify(String hostname, SSLSession session) {
return hostnameverifier.verify(hostname, session);
}
+ @Override
public void verify(String host, String[] cns, String[] subjectAlts)
throws SSLException {
throw new UnsupportedOperationException(); // TODO message
}
+ @Override
public void verify(String host, X509Certificate cert)
throws SSLException {
throw new UnsupportedOperationException(); // TODO message
}
+ @Override
public void verify(String host, SSLSocket ssl) throws IOException {
hostnameverifier.verify(host, ssl.getSession());
}
};
}
+ @Override
public void configure(KeyManager[] km, TrustManager[] tm,
SecureRandom random) throws KeyManagementException {
getSSLContext().init(km, tm, random);
diff --git a/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnectionFactory.java b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnectionFactory.java
index fe1eef484a..f97d284b46 100644
--- a/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnectionFactory.java
+++ b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnectionFactory.java
@@ -55,10 +55,12 @@ import org.eclipse.jgit.transport.http.HttpConnectionFactory;
* @since 3.3
*/
public class HttpClientConnectionFactory implements HttpConnectionFactory {
+ @Override
public HttpConnection create(URL url) throws IOException {
return new HttpClientConnection(url.toString());
}
+ @Override
public HttpConnection create(URL url, Proxy proxy)
throws IOException {
return new HttpClientConnection(url.toString(), proxy);
diff --git a/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/TemporaryBufferEntity.java b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/TemporaryBufferEntity.java
index 93328c96ca..3efff49d08 100644
--- a/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/TemporaryBufferEntity.java
+++ b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/TemporaryBufferEntity.java
@@ -78,25 +78,30 @@ public class TemporaryBufferEntity extends AbstractHttpEntity
return buffer;
}
+ @Override
public boolean isRepeatable() {
return true;
}
+ @Override
public long getContentLength() {
if (contentLength != null)
return contentLength.intValue();
return buffer.length();
}
+ @Override
public InputStream getContent() throws IOException, IllegalStateException {
return buffer.openInputStream();
}
+ @Override
public void writeTo(OutputStream outstream) throws IOException {
// TODO: dont we need a progressmonitor
buffer.writeTo(outstream, null);
}
+ @Override
public boolean isStreaming() {
return false;
}
diff --git a/org.eclipse.jgit.http.server/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.http.server/.settings/org.eclipse.jdt.core.prefs
index 80cfbbbd3b..4d260cf480 100644
--- a/org.eclipse.jgit.http.server/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.http.server/.settings/org.eclipse.jdt.core.prefs
@@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -76,7 +76,7 @@ org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
diff --git a/org.eclipse.jgit.http.server/BUCK b/org.eclipse.jgit.http.server/BUCK
deleted file mode 100644
index 3743557aa5..0000000000
--- a/org.eclipse.jgit.http.server/BUCK
+++ /dev/null
@@ -1,10 +0,0 @@
-java_library(
- name = 'jgit-servlet',
- srcs = glob(['src/**']),
- resources = glob(['resources/**']),
- provided_deps = [
- '//org.eclipse.jgit:jgit',
- '//lib:servlet-api',
- ],
- visibility = ['PUBLIC'],
-)
diff --git a/org.eclipse.jgit.http.server/BUILD b/org.eclipse.jgit.http.server/BUILD
new file mode 100644
index 0000000000..876c5fa85f
--- /dev/null
+++ b/org.eclipse.jgit.http.server/BUILD
@@ -0,0 +1,13 @@
+package(default_visibility = ["//visibility:public"])
+
+java_library(
+ name = "jgit-servlet",
+ srcs = glob(["src/**"]),
+ resource_strip_prefix = "org.eclipse.jgit.http.server/resources",
+ resources = glob(["resources/**"]),
+ deps = [
+ "//lib:servlet-api",
+ # We want these deps to be provided_deps
+ "//org.eclipse.jgit:jgit",
+ ],
+)
diff --git a/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF
index be3bb333bd..26fc9e96be 100644
--- a/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF
@@ -2,13 +2,13 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin_name
Bundle-SymbolicName: org.eclipse.jgit.http.server
-Bundle-Version: 4.6.2.qualifier
+Bundle-Version: 4.7.8.qualifier
Bundle-Localization: plugin
Bundle-Vendor: %provider_name
-Export-Package: org.eclipse.jgit.http.server;version="4.6.2",
- org.eclipse.jgit.http.server.glue;version="4.6.2";
+Export-Package: org.eclipse.jgit.http.server;version="4.7.8",
+ org.eclipse.jgit.http.server.glue;version="4.7.8";
uses:="javax.servlet,javax.servlet.http",
- org.eclipse.jgit.http.server.resolver;version="4.6.2";
+ org.eclipse.jgit.http.server.resolver;version="4.7.8";
uses:="org.eclipse.jgit.transport.resolver,
org.eclipse.jgit.lib,
org.eclipse.jgit.transport,
@@ -17,12 +17,12 @@ Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: javax.servlet;version="[2.5.0,3.2.0)",
javax.servlet.http;version="[2.5.0,3.2.0)",
- org.eclipse.jgit.errors;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.internal.storage.dfs;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.internal.storage.file;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lib;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.nls;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.revwalk;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.transport;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.transport.resolver;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.util;version="[4.6.2,4.7.0)"
+ org.eclipse.jgit.errors;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.internal.storage.dfs;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.internal.storage.file;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lib;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.nls;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.revwalk;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.transport;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.transport.resolver;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.util;version="[4.7.8,4.8.0)"
diff --git a/org.eclipse.jgit.http.server/pom.xml b/org.eclipse.jgit.http.server/pom.xml
index 843ec4bf72..022dc7fe89 100644
--- a/org.eclipse.jgit.http.server/pom.xml
+++ b/org.eclipse.jgit.http.server/pom.xml
@@ -52,7 +52,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit-parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.jgit.http.server</artifactId>
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java
index d33362b4b4..05391eb75d 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java
@@ -70,14 +70,17 @@ class AsIsFileFilter implements Filter {
this.asIs = getAnyFile;
}
+ @Override
public void init(FilterConfig config) throws ServletException {
// Do nothing.
}
+ @Override
public void destroy() {
// Do nothing.
}
+ @Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletRequest req = (HttpServletRequest) request;
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 529b8391fa..807037155c 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
@@ -95,9 +95,9 @@ public class GitFilter extends MetaFilter {
private ReceivePackFactory<HttpServletRequest> receivePackFactory = new DefaultReceivePackFactory();
- private final List<Filter> uploadPackFilters = new LinkedList<Filter>();
+ private final List<Filter> uploadPackFilters = new LinkedList<>();
- private final List<Filter> receivePackFilters = new LinkedList<Filter>();
+ private final List<Filter> receivePackFilters = new LinkedList<>();
/**
* New servlet that will load its base directory from {@code web.xml}.
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitServlet.java
index bca521025d..3a5edeebee 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitServlet.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitServlet.java
@@ -174,18 +174,22 @@ public class GitServlet extends MetaServlet {
@Override
public void init(final ServletConfig config) throws ServletException {
gitFilter.init(new FilterConfig() {
+ @Override
public String getFilterName() {
return gitFilter.getClass().getName();
}
+ @Override
public String getInitParameter(String name) {
return config.getInitParameter(name);
}
+ @Override
public Enumeration<String> getInitParameterNames() {
return config.getInitParameterNames();
}
+ @Override
public ServletContext getServletContext() {
return config.getServletContext();
}
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoPacksServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoPacksServlet.java
index bb6efb84b2..91c2f9fd9e 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoPacksServlet.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoPacksServlet.java
@@ -60,6 +60,7 @@ import org.eclipse.jgit.lib.ObjectDatabase;
class InfoPacksServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
+ @Override
public void doGet(final HttpServletRequest req,
final HttpServletResponse rsp) throws IOException {
sendPlainText(packList(req), req, rsp);
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java
index 446f6a2c8d..72c71369dc 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java
@@ -64,6 +64,7 @@ import org.eclipse.jgit.util.HttpSupport;
class InfoRefsServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
+ @Override
public void doGet(final HttpServletRequest req,
final HttpServletResponse rsp) throws IOException {
// Assume a dumb client and send back the dumb client
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/IsLocalFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/IsLocalFilter.java
index 511cdf1935..223813feb3 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/IsLocalFilter.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/IsLocalFilter.java
@@ -66,14 +66,17 @@ import org.eclipse.jgit.lib.Repository;
* downstream servlet can directly access its contents on disk.
*/
class IsLocalFilter implements Filter {
+ @Override
public void init(FilterConfig config) throws ServletException {
// Do nothing.
}
+ @Override
public void destroy() {
// Do nothing.
}
+ @Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
if (isLocal(getRepository(request)))
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/NoCacheFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/NoCacheFilter.java
index 6a23cb95f5..bdc3420aa9 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/NoCacheFilter.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/NoCacheFilter.java
@@ -59,14 +59,17 @@ import javax.servlet.http.HttpServletResponse;
/** Adds HTTP response headers to prevent caching by proxies/browsers. */
class NoCacheFilter implements Filter {
+ @Override
public void init(FilterConfig config) throws ServletException {
// Do nothing.
}
+ @Override
public void destroy() {
// Do nothing.
}
+ @Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletResponse rsp = (HttpServletResponse) response;
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java
index c88670ec97..9d24bf7d07 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java
@@ -130,6 +130,7 @@ class ReceivePackServlet extends HttpServlet {
this.receivePackFactory = receivePackFactory;
}
+ @Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletRequest req = (HttpServletRequest) request;
@@ -153,10 +154,12 @@ class ReceivePackServlet extends HttpServlet {
}
}
+ @Override
public void init(FilterConfig filterConfig) throws ServletException {
// Nothing.
}
+ @Override
public void destroy() {
// Nothing.
}
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/RepositoryFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/RepositoryFilter.java
index b3fad3d959..de09c545e5 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/RepositoryFilter.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/RepositoryFilter.java
@@ -100,14 +100,17 @@ public class RepositoryFilter implements Filter {
this.resolver = resolver;
}
+ @Override
public void init(final FilterConfig config) throws ServletException {
context = config.getServletContext();
}
+ @Override
public void destroy() {
context = null;
}
+ @Override
public void doFilter(final ServletRequest request,
final ServletResponse response, final FilterChain chain)
throws IOException, ServletException {
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartOutputStream.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartOutputStream.java
index 145c63bcaf..08a5eba15f 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartOutputStream.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartOutputStream.java
@@ -95,6 +95,7 @@ class SmartOutputStream extends TemporaryBuffer {
return out;
}
+ @Override
public void close() throws IOException {
super.close();
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java
index a06bb1e9ed..fe34f6691f 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java
@@ -80,14 +80,17 @@ abstract class SmartServiceInfoRefs implements Filter {
this.filters = filters.toArray(new Filter[filters.size()]);
}
+ @Override
public void init(FilterConfig config) throws ServletException {
// Do nothing.
}
+ @Override
public void destroy() {
// Do nothing.
}
+ @Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
final HttpServletRequest req = (HttpServletRequest) request;
@@ -154,6 +157,7 @@ abstract class SmartServiceInfoRefs implements Filter {
private class Chain implements FilterChain {
private int filterIdx;
+ @Override
public void doFilter(ServletRequest req, ServletResponse rsp)
throws IOException, ServletException {
if (filterIdx < filters.length)
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/TextFileServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/TextFileServlet.java
index 650059bd38..28ee17dcd1 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/TextFileServlet.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/TextFileServlet.java
@@ -68,6 +68,7 @@ class TextFileServlet extends HttpServlet {
this.fileName = name;
}
+ @Override
public void doGet(final HttpServletRequest req,
final HttpServletResponse rsp) throws IOException {
try {
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java
index a9a0c5b128..97d00c10a1 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java
@@ -129,6 +129,7 @@ class UploadPackServlet extends HttpServlet {
this.uploadPackFactory = uploadPackFactory;
}
+ @Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletRequest req = (HttpServletRequest) request;
@@ -152,10 +153,12 @@ class UploadPackServlet extends HttpServlet {
}
}
+ @Override
public void init(FilterConfig filterConfig) throws ServletException {
// Nothing.
}
+ @Override
public void destroy() {
// Nothing.
}
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaFilter.java
index 2187cfaa42..adb6c425df 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaFilter.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaFilter.java
@@ -89,7 +89,7 @@ public class MetaFilter implements Filter {
/** Empty filter with no bindings. */
public MetaFilter() {
- this.bindings = new ArrayList<ServletBinderImpl>();
+ this.bindings = new ArrayList<>();
}
/**
@@ -128,10 +128,12 @@ public class MetaFilter implements Filter {
return register(new RegexPipeline.Binder(pattern));
}
+ @Override
public void init(FilterConfig filterConfig) throws ServletException {
servletContext = filterConfig.getServletContext();
}
+ @Override
public void destroy() {
if (pipelines != null) {
Set<Object> destroyed = newIdentitySet();
@@ -142,7 +144,7 @@ public class MetaFilter implements Filter {
}
private static Set<Object> newIdentitySet() {
- final Map<Object, Object> m = new IdentityHashMap<Object, Object>();
+ final Map<Object, Object> m = new IdentityHashMap<>();
return new AbstractSet<Object>() {
@Override
public boolean add(Object o) {
@@ -166,6 +168,7 @@ public class MetaFilter implements Filter {
};
}
+ @Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletRequest req = (HttpServletRequest) request;
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaServlet.java
index 05060658d6..71365c8f44 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaServlet.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaServlet.java
@@ -123,6 +123,7 @@ public class MetaServlet extends HttpServlet {
filter.init(new NoParameterFilterConfig(name, ctx));
}
+ @Override
public void destroy() {
filter.destroy();
}
@@ -131,6 +132,7 @@ public class MetaServlet extends HttpServlet {
protected void service(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
filter.doFilter(req, res, new FilterChain() {
+ @Override
public void doFilter(ServletRequest request,
ServletResponse response) throws IOException,
ServletException {
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/NoParameterFilterConfig.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/NoParameterFilterConfig.java
index 8dfcc4d149..961f88e4f8 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/NoParameterFilterConfig.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/NoParameterFilterConfig.java
@@ -59,26 +59,32 @@ final class NoParameterFilterConfig implements FilterConfig {
this.context = context;
}
+ @Override
public String getInitParameter(String name) {
return null;
}
+ @Override
public Enumeration<String> getInitParameterNames() {
return new Enumeration<String>() {
+ @Override
public boolean hasMoreElements() {
return false;
}
+ @Override
public String nextElement() {
throw new NoSuchElementException();
}
};
}
+ @Override
public ServletContext getServletContext() {
return context;
}
+ @Override
public String getFilterName() {
return filterName;
}
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexGroupFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexGroupFilter.java
index 2414660a06..a402977ad1 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexGroupFilter.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexGroupFilter.java
@@ -79,14 +79,17 @@ public class RegexGroupFilter implements Filter {
this.groupIdx = groupIdx - 1;
}
+ @Override
public void init(FilterConfig config) throws ServletException {
// Do nothing.
}
+ @Override
public void destroy() {
// Do nothing.
}
+ @Override
public void doFilter(final ServletRequest request,
final ServletResponse rsp, final FilterChain chain)
throws IOException, ServletException {
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexPipeline.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexPipeline.java
index 2ef71368d0..f33243b3b5 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexPipeline.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexPipeline.java
@@ -95,6 +95,7 @@ class RegexPipeline extends UrlPipeline {
pattern = p;
}
+ @Override
UrlPipeline create() {
return new RegexPipeline(pattern, getFilters(), getServlet());
}
@@ -108,6 +109,7 @@ class RegexPipeline extends UrlPipeline {
this.pattern = pattern;
}
+ @Override
boolean match(final HttpServletRequest req) {
final String pathInfo = req.getPathInfo();
return pathInfo != null && pattern.matcher(pathInfo).matches();
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/ServletBinderImpl.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/ServletBinderImpl.java
index e96fc59dc3..4e879a9760 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/ServletBinderImpl.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/ServletBinderImpl.java
@@ -58,9 +58,10 @@ abstract class ServletBinderImpl implements ServletBinder {
private HttpServlet httpServlet;
ServletBinderImpl() {
- this.filters = new ArrayList<Filter>();
+ this.filters = new ArrayList<>();
}
+ @Override
public ServletBinder through(Filter filter) {
if (filter == null)
throw new NullPointerException(HttpServerText.get().filterMustNotBeNull);
@@ -68,6 +69,7 @@ abstract class ServletBinderImpl implements ServletBinder {
return this;
}
+ @Override
public void with(HttpServlet servlet) {
if (servlet == null)
throw new NullPointerException(HttpServerText.get().servletMustNotBeNull);
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/SuffixPipeline.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/SuffixPipeline.java
index b942016259..903de63b8e 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/SuffixPipeline.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/SuffixPipeline.java
@@ -71,6 +71,7 @@ class SuffixPipeline extends UrlPipeline {
this.suffix = suffix;
}
+ @Override
UrlPipeline create() {
return new SuffixPipeline(suffix, getFilters(), getServlet());
}
@@ -87,6 +88,7 @@ class SuffixPipeline extends UrlPipeline {
this.suffixLen = suffix.length();
}
+ @Override
boolean match(final HttpServletRequest req) {
final String pathInfo = req.getPathInfo();
return pathInfo != null && pathInfo.endsWith(suffix);
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/UrlPipeline.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/UrlPipeline.java
index 2d0b844072..56e4e22889 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/UrlPipeline.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/UrlPipeline.java
@@ -121,26 +121,32 @@ abstract class UrlPipeline {
throws ServletException {
if (!inited.contains(ref)) {
ref.init(new ServletConfig() {
+ @Override
public String getInitParameter(String name) {
return null;
}
+ @Override
public Enumeration<String> getInitParameterNames() {
return new Enumeration<String>() {
+ @Override
public boolean hasMoreElements() {
return false;
}
+ @Override
public String nextElement() {
throw new NoSuchElementException();
}
};
}
+ @Override
public ServletContext getServletContext() {
return context;
}
+ @Override
public String getServletName() {
return ref.getClass().getName();
}
@@ -229,6 +235,7 @@ abstract class UrlPipeline {
this.servlet = servlet;
}
+ @Override
public void doFilter(ServletRequest req, ServletResponse rsp)
throws IOException, ServletException {
if (filterIdx < filters.length)
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/AsIsFileService.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/AsIsFileService.java
index 4ef2a7c4cb..88ad472acb 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/AsIsFileService.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/AsIsFileService.java
@@ -72,6 +72,7 @@ public class AsIsFileService {
};
private static final SectionParser<ServiceConfig> CONFIG = new SectionParser<ServiceConfig>() {
+ @Override
public ServiceConfig parse(final Config cfg) {
return new ServiceConfig(cfg);
}
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultReceivePackFactory.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultReceivePackFactory.java
index 8c39b7997b..04e192bcfb 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultReceivePackFactory.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultReceivePackFactory.java
@@ -69,6 +69,7 @@ import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException;
public class DefaultReceivePackFactory implements
ReceivePackFactory<HttpServletRequest> {
private static final SectionParser<ServiceConfig> CONFIG = new SectionParser<ServiceConfig>() {
+ @Override
public ServiceConfig parse(final Config cfg) {
return new ServiceConfig(cfg);
}
@@ -85,6 +86,7 @@ public class DefaultReceivePackFactory implements
}
}
+ @Override
public ReceivePack create(final HttpServletRequest req, final Repository db)
throws ServiceNotEnabledException, ServiceNotAuthorizedException {
final ServiceConfig cfg = db.getConfig().get(CONFIG);
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultUploadPackFactory.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultUploadPackFactory.java
index 34c069e0e1..d01e2efca4 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultUploadPackFactory.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultUploadPackFactory.java
@@ -62,6 +62,7 @@ import org.eclipse.jgit.transport.resolver.UploadPackFactory;
public class DefaultUploadPackFactory implements
UploadPackFactory<HttpServletRequest> {
private static final SectionParser<ServiceConfig> CONFIG = new SectionParser<ServiceConfig>() {
+ @Override
public ServiceConfig parse(final Config cfg) {
return new ServiceConfig(cfg);
}
@@ -75,6 +76,7 @@ public class DefaultUploadPackFactory implements
}
}
+ @Override
public UploadPack create(final HttpServletRequest req, final Repository db)
throws ServiceNotEnabledException, ServiceNotAuthorizedException {
if (db.getConfig().get(CONFIG).enabled)
diff --git a/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs
index 10c29d5576..64f74989e1 100644
--- a/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs
@@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -76,7 +76,7 @@ org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
diff --git a/org.eclipse.jgit.http.test/BUCK b/org.eclipse.jgit.http.test/BUCK
deleted file mode 100644
index f5cd10e58b..0000000000
--- a/org.eclipse.jgit.http.test/BUCK
+++ /dev/null
@@ -1,41 +0,0 @@
-TESTS = glob(['tst/**/*.java'])
-
-for t in TESTS:
- n = t[len('tst/'):len(t)-len('.java')].replace('/', '.')
- java_test(
- name = n,
- labels = ['http'],
- srcs = [t],
- deps = [
- ':helpers',
- '//org.eclipse.jgit:jgit',
- '//org.eclipse.jgit.http.apache:http-apache',
- '//org.eclipse.jgit.http.server:jgit-servlet',
- '//org.eclipse.jgit.junit:junit',
- '//org.eclipse.jgit.junit.http:junit-http',
- '//lib:hamcrest-core',
- '//lib:hamcrest-library',
- '//lib:junit',
- '//lib:servlet-api',
- '//lib/jetty:http',
- '//lib/jetty:io',
- '//lib/jetty:server',
- '//lib/jetty:servlet',
- '//lib/jetty:security',
- '//lib/jetty:util',
- '//lib:commons-logging',
- ],
- vm_args = ['-Djava.io.tmpdir=buck-out'],
- )
-
-java_library(
- name = 'helpers',
- srcs = glob(['src/**/*.java']),
- deps = [
- '//org.eclipse.jgit:jgit',
- '//org.eclipse.jgit.http.server:jgit-servlet',
- '//org.eclipse.jgit.junit:junit',
- '//org.eclipse.jgit.junit.http:junit-http',
- '//lib:junit',
- ],
-)
diff --git a/org.eclipse.jgit.http.test/BUILD b/org.eclipse.jgit.http.test/BUILD
new file mode 100644
index 0000000000..ce2d6112f1
--- /dev/null
+++ b/org.eclipse.jgit.http.test/BUILD
@@ -0,0 +1,42 @@
+load(
+ "@com_googlesource_gerrit_bazlets//tools:junit.bzl",
+ "junit_tests",
+)
+
+junit_tests(
+ name = "http",
+ srcs = glob(["tst/**/*.java"]),
+ tags = ["http"],
+ deps = [
+ ":helpers",
+ "//lib:commons-logging",
+ "//lib:jetty-http",
+ "//lib:jetty-io",
+ "//lib:jetty-security",
+ "//lib:jetty-server",
+ "//lib:jetty-servlet",
+ "//lib:jetty-util",
+ "//lib:junit",
+ "//lib:servlet-api",
+ "//lib:slf4j-api",
+ "//lib:slf4j-simple",
+ "//org.eclipse.jgit.http.apache:http-apache",
+ "//org.eclipse.jgit.http.server:jgit-servlet",
+ "//org.eclipse.jgit:jgit",
+ "//org.eclipse.jgit.junit.http:junit-http",
+ "//org.eclipse.jgit.junit:junit",
+ ],
+)
+
+java_library(
+ name = "helpers",
+ testonly = 1,
+ srcs = glob(["src/**/*.java"]),
+ deps = [
+ "//lib:junit",
+ "//org.eclipse.jgit.http.server:jgit-servlet",
+ "//org.eclipse.jgit:jgit",
+ "//org.eclipse.jgit.junit.http:junit-http",
+ "//org.eclipse.jgit.junit:junit",
+ ],
+)
diff --git a/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF
index 6effed6f95..82acb2b0f3 100644
--- a/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin_name
Bundle-SymbolicName: org.eclipse.jgit.http.test
-Bundle-Version: 4.6.2.qualifier
+Bundle-Version: 4.7.8.qualifier
Bundle-Vendor: %provider_name
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
@@ -22,24 +22,24 @@ Import-Package: javax.servlet;version="[2.5.0,3.2.0)",
org.eclipse.jetty.util.log;version="[9.0.0,9.4.0)",
org.eclipse.jetty.util.security;version="[9.0.0,9.4.0)",
org.eclipse.jetty.util.thread;version="[9.0.0,9.4.0)",
- org.eclipse.jgit.errors;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.http.server;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.http.server.glue;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.http.server.resolver;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.internal;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.internal.storage.dfs;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.internal.storage.file;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.junit;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.junit.http;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lib;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.nls;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.revwalk;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.storage.file;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.transport;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.transport.http;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.transport.http.apache;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.transport.resolver;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.util;version="[4.6.2,4.7.0)",
+ org.eclipse.jgit.errors;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.http.server;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.http.server.glue;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.http.server.resolver;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.internal;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.internal.storage.dfs;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.internal.storage.file;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.junit;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.junit.http;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lib;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.nls;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.revwalk;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.storage.file;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.transport;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.transport.http;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.transport.http.apache;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.transport.resolver;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.util;version="[4.7.8,4.8.0)",
org.hamcrest.core;version="[1.1.0,2.0.0)",
org.junit;version="[4.0.0,5.0.0)",
org.junit.runner;version="[4.0.0,5.0.0)",
diff --git a/org.eclipse.jgit.http.test/pom.xml b/org.eclipse.jgit.http.test/pom.xml
index 0366f757b6..8865741d21 100644
--- a/org.eclipse.jgit.http.test/pom.xml
+++ b/org.eclipse.jgit.http.test/pom.xml
@@ -51,7 +51,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit-parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.jgit.http.test</artifactId>
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AdvertiseErrorTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AdvertiseErrorTest.java
index 0285bd1679..0e92b1460c 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AdvertiseErrorTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AdvertiseErrorTest.java
@@ -80,6 +80,7 @@ public class AdvertiseErrorTest extends HttpTestCase {
private URIish remoteURI;
+ @Override
@Before
public void setUp() throws Exception {
super.setUp();
@@ -90,6 +91,7 @@ public class AdvertiseErrorTest extends HttpTestCase {
ServletContextHandler app = server.addContext("/git");
GitServlet gs = new GitServlet();
gs.setRepositoryResolver(new RepositoryResolver<HttpServletRequest>() {
+ @Override
public Repository open(HttpServletRequest req, String name)
throws RepositoryNotFoundException,
ServiceNotEnabledException {
@@ -102,6 +104,7 @@ public class AdvertiseErrorTest extends HttpTestCase {
}
});
gs.setReceivePackFactory(new DefaultReceivePackFactory() {
+ @Override
public ReceivePack create(HttpServletRequest req, Repository db)
throws ServiceNotEnabledException,
ServiceNotAuthorizedException {
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AsIsServiceTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AsIsServiceTest.java
index c6b8f092bf..e94a792ff2 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AsIsServiceTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AsIsServiceTest.java
@@ -64,6 +64,7 @@ public class AsIsServiceTest extends LocalDiskRepositoryTestCase {
private AsIsFileService service;
+ @Override
@Before
public void setUp() throws Exception {
super.setUp();
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultReceivePackFactoryTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultReceivePackFactoryTest.java
index f2879e0fac..b24e2dfc7b 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultReceivePackFactoryTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultReceivePackFactoryTest.java
@@ -71,6 +71,7 @@ public class DefaultReceivePackFactoryTest extends LocalDiskRepositoryTestCase {
private ReceivePackFactory<HttpServletRequest> factory;
+ @Override
@Before
public void setUp() throws Exception {
super.setUp();
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultUploadPackFactoryTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultUploadPackFactoryTest.java
index 3bcb0571b9..ce24d64b7b 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultUploadPackFactoryTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultUploadPackFactoryTest.java
@@ -69,6 +69,7 @@ public class DefaultUploadPackFactoryTest extends LocalDiskRepositoryTestCase {
private UploadPackFactory<HttpServletRequest> factory;
+ @Override
@Before
public void setUp() throws Exception {
super.setUp();
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java
index 677132d732..ab6dc35f79 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java
@@ -109,6 +109,7 @@ public class DumbClientDumbServerTest extends HttpTestCase {
HttpTransport.setConnectionFactory(cf);
}
+ @Override
@Before
public void setUp() throws Exception {
super.setUp();
@@ -212,7 +213,7 @@ public class DumbClientDumbServerTest extends HttpTestCase {
@Test
public void testInitialClone_Packed() throws Exception {
- new TestRepository<Repository>(remoteRepository).packAndPrune();
+ new TestRepository<>(remoteRepository).packAndPrune();
Repository dst = createBareRepository();
assertFalse(dst.hasObject(A_txt));
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java
index bce44f9bf3..06bfd7988b 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java
@@ -114,6 +114,7 @@ public class DumbClientSmartServerTest extends HttpTestCase {
HttpTransport.setConnectionFactory(cf);
}
+ @Override
@Before
public void setUp() throws Exception {
super.setUp();
@@ -124,6 +125,7 @@ public class DumbClientSmartServerTest extends HttpTestCase {
ServletContextHandler app = server.addContext("/git");
GitServlet gs = new GitServlet();
gs.setRepositoryResolver(new RepositoryResolver<HttpServletRequest>() {
+ @Override
public Repository open(HttpServletRequest req, String name)
throws RepositoryNotFoundException,
ServiceNotEnabledException {
@@ -239,7 +241,7 @@ public class DumbClientSmartServerTest extends HttpTestCase {
@Test
public void testInitialClone_Packed() throws Exception {
- new TestRepository<Repository>(remoteRepository).packAndPrune();
+ new TestRepository<>(remoteRepository).packAndPrune();
Repository dst = createBareRepository();
assertFalse(dst.hasObject(A_txt));
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 7c6d591513..82e79b8e50 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
@@ -83,7 +83,7 @@ public class FileResolverTest extends LocalDiskRepositoryTestCase {
private static void assertUnreasonable(String name)
throws ServiceNotEnabledException {
- FileResolver<RepositoryResolver> r = new FileResolver<RepositoryResolver>(
+ FileResolver<RepositoryResolver> r = new FileResolver<>(
new File("."), false);
try {
r.open(null, name);
@@ -103,7 +103,7 @@ public class FileResolverTest extends LocalDiskRepositoryTestCase {
FileResolver<RepositoryResolver> resolver;
assertFalse("no git-daemon-export-ok", export.exists());
- resolver = new FileResolver<RepositoryResolver>(base, false /*
+ resolver = new FileResolver<>(base, false /*
* require
* flag
*/);
@@ -114,7 +114,7 @@ public class FileResolverTest extends LocalDiskRepositoryTestCase {
assertEquals("Service not enabled", e.getMessage());
}
- resolver = new FileResolver<RepositoryResolver>(base, true /*
+ resolver = new FileResolver<>(base, true /*
* export
* all
*/);
@@ -125,7 +125,7 @@ public class FileResolverTest extends LocalDiskRepositoryTestCase {
}
FileUtils.createNewFile(export);
- resolver = new FileResolver<RepositoryResolver>(base, false /*
+ resolver = new FileResolver<>(base, false /*
* require
* flag
*/);
@@ -142,7 +142,7 @@ public class FileResolverTest extends LocalDiskRepositoryTestCase {
final Repository a = createBareRepository();
final String name = a.getDirectory().getName() + "-not-a-git";
final File base = a.getDirectory().getParentFile();
- FileResolver<RepositoryResolver> resolver = new FileResolver<RepositoryResolver>(
+ FileResolver<RepositoryResolver> resolver = new FileResolver<>(
base, false);
try {
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/GitServletResponseTests.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/GitServletResponseTests.java
index 4b15d4b533..de7891c445 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/GitServletResponseTests.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/GitServletResponseTests.java
@@ -107,6 +107,7 @@ public class GitServletResponseTests extends HttpTestCase {
* configure the maximum pack file size, the object checker and custom hooks
* just before they talk to the server.
*/
+ @Override
@Before
public void setUp() throws Exception {
super.setUp();
@@ -117,6 +118,7 @@ public class GitServletResponseTests extends HttpTestCase {
ServletContextHandler app = server.addContext("/git");
gs = new GitServlet();
gs.setRepositoryResolver(new RepositoryResolver<HttpServletRequest>() {
+ @Override
public Repository open(HttpServletRequest req, String name)
throws RepositoryNotFoundException,
ServiceNotEnabledException {
@@ -129,6 +131,7 @@ public class GitServletResponseTests extends HttpTestCase {
}
});
gs.setReceivePackFactory(new DefaultReceivePackFactory() {
+ @Override
public ReceivePack create(HttpServletRequest req, Repository db)
throws ServiceNotEnabledException,
ServiceNotAuthorizedException {
@@ -266,10 +269,11 @@ public class GitServletResponseTests extends HttpTestCase {
Transport t;
// this maxPackSize leads to an unPackError
- maxPackSize = 400;
+ maxPackSize = 100;
// this PostReceiveHook when called after an unsuccesfull unpack will
// lead to an IllegalStateException
postHook = new PostReceiveHook() {
+ @Override
public void onPostReceive(ReceivePack rp,
Collection<ReceiveCommand> commands) {
// the maxPackSize setting caused that the packfile couldn't be
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HookMessageTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HookMessageTest.java
index d67c8173cb..adb69ec279 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HookMessageTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HookMessageTest.java
@@ -88,6 +88,7 @@ public class HookMessageTest extends HttpTestCase {
private URIish remoteURI;
+ @Override
@Before
public void setUp() throws Exception {
super.setUp();
@@ -98,6 +99,7 @@ public class HookMessageTest extends HttpTestCase {
ServletContextHandler app = server.addContext("/git");
GitServlet gs = new GitServlet();
gs.setRepositoryResolver(new RepositoryResolver<HttpServletRequest>() {
+ @Override
public Repository open(HttpServletRequest req, String name)
throws RepositoryNotFoundException,
ServiceNotEnabledException {
@@ -110,11 +112,13 @@ public class HookMessageTest extends HttpTestCase {
}
});
gs.setReceivePackFactory(new DefaultReceivePackFactory() {
+ @Override
public ReceivePack create(HttpServletRequest req, Repository db)
throws ServiceNotEnabledException,
ServiceNotAuthorizedException {
ReceivePack recv = super.create(req, db);
recv.setPreReceiveHook(new PreReceiveHook() {
+ @Override
public void onPreReceive(ReceivePack rp,
Collection<ReceiveCommand> commands) {
rp.sendMessage("message line 1");
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java
index ce78442785..6dbe0e3cdd 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java
@@ -94,6 +94,7 @@ public class HttpClientTests extends HttpTestCase {
private URIish smartAuthBasicURI;
+ @Override
@Before
public void setUp() throws Exception {
super.setUp();
@@ -132,6 +133,7 @@ public class HttpClientTests extends HttpTestCase {
private ServletContextHandler smart(final String path) {
GitServlet gs = new GitServlet();
gs.setRepositoryResolver(new RepositoryResolver<HttpServletRequest>() {
+ @Override
public Repository open(HttpServletRequest req, String name)
throws RepositoryNotFoundException,
ServiceNotEnabledException {
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/MeasurePackSizeTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/MeasurePackSizeTest.java
index 108e7bb728..4c08ec2637 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/MeasurePackSizeTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/MeasurePackSizeTest.java
@@ -83,6 +83,7 @@ public class MeasurePackSizeTest extends HttpTestCase {
long packSize = -1;
+ @Override
@Before
public void setUp() throws Exception {
super.setUp();
@@ -93,6 +94,7 @@ public class MeasurePackSizeTest extends HttpTestCase {
ServletContextHandler app = server.addContext("/git");
GitServlet gs = new GitServlet();
gs.setRepositoryResolver(new RepositoryResolver<HttpServletRequest>() {
+ @Override
public Repository open(HttpServletRequest req, String name)
throws RepositoryNotFoundException,
ServiceNotEnabledException {
@@ -105,12 +107,14 @@ public class MeasurePackSizeTest extends HttpTestCase {
}
});
gs.setReceivePackFactory(new DefaultReceivePackFactory() {
+ @Override
public ReceivePack create(HttpServletRequest req, Repository db)
throws ServiceNotEnabledException,
ServiceNotAuthorizedException {
ReceivePack recv = super.create(req, db);
recv.setPostReceiveHook(new PostReceiveHook() {
+ @Override
public void onPostReceive(ReceivePack rp,
Collection<ReceiveCommand> commands) {
packSize = rp.getPackSize();
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/ProtocolErrorTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/ProtocolErrorTest.java
index 68c5a3a439..87d0bad85c 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/ProtocolErrorTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/ProtocolErrorTest.java
@@ -84,6 +84,7 @@ public class ProtocolErrorTest extends HttpTestCase {
private RevBlob a_blob;
+ @Override
@Before
public void setUp() throws Exception {
super.setUp();
@@ -94,6 +95,7 @@ public class ProtocolErrorTest extends HttpTestCase {
ServletContextHandler app = server.addContext("/git");
GitServlet gs = new GitServlet();
gs.setRepositoryResolver(new RepositoryResolver<HttpServletRequest>() {
+ @Override
public Repository open(HttpServletRequest req, String name)
throws RepositoryNotFoundException,
ServiceNotEnabledException {
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/RegexPipelineTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/RegexPipelineTest.java
index 64fbc01d4d..725a5902df 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/RegexPipelineTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/RegexPipelineTest.java
@@ -93,12 +93,14 @@ public class RegexPipelineTest extends HttpTestCase {
}
}
+ @Override
@Before
public void setUp() throws Exception {
server = new AppServer();
ctx = server.addContext("/");
}
+ @Override
@After
public void tearDown() throws Exception {
server.tearDown();
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SetAdditionalHeadersTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SetAdditionalHeadersTest.java
index 5be7834546..ef8daec31f 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SetAdditionalHeadersTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SetAdditionalHeadersTest.java
@@ -77,6 +77,7 @@ public class SetAdditionalHeadersTest extends HttpTestCase {
private RevCommit A, B;
+ @Override
@Before
public void setUp() throws Exception {
super.setUp();
@@ -111,7 +112,7 @@ public class SetAdditionalHeadersTest extends HttpTestCase {
assertTrue("isa TransportHttp", t instanceof TransportHttp);
assertTrue("isa HttpTransport", t instanceof HttpTransport);
- HashMap<String, String> headers = new HashMap<String, String>();
+ HashMap<String, String> headers = new HashMap<>();
headers.put("Cookie", "someTokenValue=23gBog34");
headers.put("AnotherKey", "someValue");
((TransportHttp) t).setAdditionalHeaders(headers);
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java
index 3e882719b3..ed223c96ef 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java
@@ -112,6 +112,7 @@ import org.eclipse.jgit.transport.http.JDKHttpConnectionFactory;
import org.eclipse.jgit.transport.http.apache.HttpClientConnectionFactory;
import org.eclipse.jgit.transport.resolver.RepositoryResolver;
import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException;
+import org.eclipse.jgit.util.HttpSupport;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -128,6 +129,8 @@ public class SmartClientSmartServerTest extends HttpTestCase {
private URIish brokenURI;
+ private URIish redirectURI;
+
private RevBlob A_txt;
private RevCommit A, B;
@@ -144,6 +147,7 @@ public class SmartClientSmartServerTest extends HttpTestCase {
HttpTransport.setConnectionFactory(cf);
}
+ @Override
@Before
public void setUp() throws Exception {
super.setUp();
@@ -155,13 +159,42 @@ public class SmartClientSmartServerTest extends HttpTestCase {
.setBoolean(ConfigConstants.CONFIG_CORE_SECTION, null,
ConfigConstants.CONFIG_KEY_LOGALLREFUPDATES, true);
- ServletContextHandler app = server.addContext("/git");
GitServlet gs = new GitServlet();
+
+ ServletContextHandler app = addNormalContext(gs, src, srcName);
+
+ ServletContextHandler broken = addBrokenContext(gs, src, srcName);
+
+ ServletContextHandler redirect = addRedirectContext(gs, src, srcName);
+
+ server.setUp();
+
+ remoteRepository = src.getRepository();
+ remoteURI = toURIish(app, srcName);
+ brokenURI = toURIish(broken, srcName);
+ redirectURI = toURIish(redirect, srcName);
+
+ A_txt = src.blob("A");
+ A = src.commit().add("A_txt", A_txt).create();
+ B = src.commit().parent(A).add("A_txt", "C").add("B", "B").create();
+ src.update(master, B);
+
+ src.update("refs/garbage/a/very/long/ref/name/to/compress", B);
+ }
+
+ private ServletContextHandler addNormalContext(GitServlet gs, TestRepository<Repository> src, String srcName) {
+ ServletContextHandler app = server.addContext("/git");
gs.setRepositoryResolver(new TestRepoResolver(src, srcName));
app.addServlet(new ServletHolder(gs), "/*");
+ return app;
+ }
+ @SuppressWarnings("unused")
+ private ServletContextHandler addBrokenContext(GitServlet gs, TestRepository<Repository> src, String srcName) {
ServletContextHandler broken = server.addContext("/bad");
broken.addFilter(new FilterHolder(new Filter() {
+
+ @Override
public void doFilter(ServletRequest request,
ServletResponse response, FilterChain chain)
throws IOException, ServletException {
@@ -173,29 +206,58 @@ public class SmartClientSmartServerTest extends HttpTestCase {
w.close();
}
- public void init(FilterConfig filterConfig) throws ServletException {
- //
+ @Override
+ public void init(FilterConfig filterConfig)
+ throws ServletException {
+ // empty
}
+ @Override
public void destroy() {
- //
+ // empty
}
}), "/" + srcName + "/git-upload-pack",
EnumSet.of(DispatcherType.REQUEST));
broken.addServlet(new ServletHolder(gs), "/*");
+ return broken;
+ }
- server.setUp();
+ @SuppressWarnings("unused")
+ private ServletContextHandler addRedirectContext(GitServlet gs,
+ TestRepository<Repository> src, String srcName) {
+ ServletContextHandler redirect = server.addContext("/redirect");
+ redirect.addFilter(new FilterHolder(new Filter() {
- remoteRepository = src.getRepository();
- remoteURI = toURIish(app, srcName);
- brokenURI = toURIish(broken, srcName);
+ @Override
+ public void init(FilterConfig filterConfig)
+ throws ServletException {
+ // empty
+ }
- A_txt = src.blob("A");
- A = src.commit().add("A_txt", A_txt).create();
- B = src.commit().parent(A).add("A_txt", "C").add("B", "B").create();
- src.update(master, B);
+ @Override
+ public void doFilter(ServletRequest request,
+ ServletResponse response, FilterChain chain)
+ throws IOException, ServletException {
+ final HttpServletResponse httpServletResponse = (HttpServletResponse) response;
+ final HttpServletRequest httpServletRequest = (HttpServletRequest) request;
+ final StringBuffer fullUrl = httpServletRequest.getRequestURL();
+ if (httpServletRequest.getQueryString() != null) {
+ fullUrl.append("?")
+ .append(httpServletRequest.getQueryString());
+ }
+ httpServletResponse
+ .setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
+ httpServletResponse.setHeader(HttpSupport.HDR_LOCATION,
+ fullUrl.toString().replace("/redirect", "/git"));
+ }
- src.update("refs/garbage/a/very/long/ref/name/to/compress", B);
+ @Override
+ public void destroy() {
+ // empty
+ }
+ }), "/*", EnumSet.of(DispatcherType.REQUEST));
+ redirect.addServlet(new ServletHolder(gs), "/*");
+ return redirect;
}
@Test
@@ -312,6 +374,52 @@ public class SmartClientSmartServerTest extends HttpTestCase {
}
@Test
+ public void testInitialClone_RedirectSmall() throws Exception {
+ Repository dst = createBareRepository();
+ assertFalse(dst.hasObject(A_txt));
+
+ try (Transport t = Transport.open(dst, redirectURI)) {
+ t.fetch(NullProgressMonitor.INSTANCE, mirror(master));
+ }
+
+ assertTrue(dst.hasObject(A_txt));
+ assertEquals(B, dst.exactRef(master).getObjectId());
+ fsck(dst, B);
+
+ List<AccessEvent> requests = getRequests();
+ assertEquals(4, requests.size());
+
+ AccessEvent firstRedirect = requests.get(0);
+ assertEquals(301, firstRedirect.getStatus());
+
+ AccessEvent info = requests.get(1);
+ assertEquals("GET", info.getMethod());
+ assertEquals(join(remoteURI, "info/refs"), info.getPath());
+ assertEquals(1, info.getParameters().size());
+ assertEquals("git-upload-pack", info.getParameter("service"));
+ assertEquals(200, info.getStatus());
+ assertEquals("application/x-git-upload-pack-advertisement",
+ info.getResponseHeader(HDR_CONTENT_TYPE));
+ assertEquals("gzip", info.getResponseHeader(HDR_CONTENT_ENCODING));
+
+ AccessEvent secondRedirect = requests.get(2);
+ assertEquals(301, secondRedirect.getStatus());
+
+ AccessEvent service = requests.get(3);
+ assertEquals("POST", service.getMethod());
+ assertEquals(join(remoteURI, "git-upload-pack"), service.getPath());
+ assertEquals(0, service.getParameters().size());
+ assertNotNull("has content-length",
+ service.getRequestHeader(HDR_CONTENT_LENGTH));
+ assertNull("not chunked",
+ service.getRequestHeader(HDR_TRANSFER_ENCODING));
+
+ assertEquals(200, service.getStatus());
+ assertEquals("application/x-git-upload-pack-result",
+ service.getResponseHeader(HDR_CONTENT_TYPE));
+ }
+
+ @Test
public void testFetch_FewLocalCommits() throws Exception {
// Bootstrap by doing the clone.
//
@@ -329,7 +437,7 @@ public class SmartClientSmartServerTest extends HttpTestCase {
// Create a new commit on the remote.
//
- b = new TestRepository<Repository>(remoteRepository).branch(master);
+ b = new TestRepository<>(remoteRepository).branch(master);
RevCommit Z = b.commit().message("Z").create();
// Now incrementally update.
@@ -389,7 +497,7 @@ public class SmartClientSmartServerTest extends HttpTestCase {
// Create a new commit on the remote.
//
- b = new TestRepository<Repository>(remoteRepository).branch(master);
+ b = new TestRepository<>(remoteRepository).branch(master);
RevCommit Z = b.commit().message("Z").create();
// Now incrementally update.
@@ -506,7 +614,7 @@ public class SmartClientSmartServerTest extends HttpTestCase {
final String repoName = "refs-unreadable";
RefsUnreadableInMemoryRepository badRefsRepo = new RefsUnreadableInMemoryRepository(
new DfsRepositoryDescription(repoName));
- final TestRepository<Repository> repo = new TestRepository<Repository>(
+ final TestRepository<Repository> repo = new TestRepository<>(
badRefsRepo);
ServletContextHandler app = noRefServer.addContext("/git");
@@ -727,6 +835,7 @@ public class SmartClientSmartServerTest extends HttpTestCase {
this.repoName = repoName;
}
+ @Override
public Repository open(HttpServletRequest req, String name)
throws RepositoryNotFoundException, ServiceNotEnabledException {
if (!name.equals(repoName))
diff --git a/org.eclipse.jgit.junit.http/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.junit.http/.settings/org.eclipse.jdt.core.prefs
index 10c29d5576..64f74989e1 100644
--- a/org.eclipse.jgit.junit.http/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.junit.http/.settings/org.eclipse.jdt.core.prefs
@@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -76,7 +76,7 @@ org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
diff --git a/org.eclipse.jgit.junit.http/BUCK b/org.eclipse.jgit.junit.http/BUCK
deleted file mode 100644
index 68976a68ae..0000000000
--- a/org.eclipse.jgit.junit.http/BUCK
+++ /dev/null
@@ -1,18 +0,0 @@
-java_library(
- name = 'junit-http',
- srcs = glob(['src/**']),
- resources = glob(['resources/**']),
- provided_deps = [
- '//org.eclipse.jgit:jgit',
- '//org.eclipse.jgit.http.server:jgit-servlet',
- '//org.eclipse.jgit.junit:junit',
- '//lib:junit',
- '//lib:servlet-api',
- '//lib/jetty:http',
- '//lib/jetty:server',
- '//lib/jetty:servlet',
- '//lib/jetty:security',
- '//lib/jetty:util',
- ],
- visibility = ['PUBLIC'],
-)
diff --git a/org.eclipse.jgit.junit.http/BUILD b/org.eclipse.jgit.junit.http/BUILD
new file mode 100644
index 0000000000..be6e1ae3ba
--- /dev/null
+++ b/org.eclipse.jgit.junit.http/BUILD
@@ -0,0 +1,22 @@
+package(default_visibility = ["//visibility:public"])
+
+java_library(
+ name = "junit-http",
+ testonly = 1,
+ srcs = glob(["src/**"]),
+ resources = glob(["resources/**"]),
+ # TODO(davido): we want here provided deps
+ deps = [
+ "//lib:jetty-http",
+ "//lib:jetty-security",
+ "//lib:jetty-server",
+ "//lib:jetty-servlet",
+ "//lib:jetty-util",
+ "//lib:junit",
+ "//lib:servlet-api",
+ "//lib:slf4j-api",
+ "//org.eclipse.jgit.http.server:jgit-servlet",
+ "//org.eclipse.jgit:jgit",
+ "//org.eclipse.jgit.junit:junit",
+ ],
+)
diff --git a/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF b/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF
index cd42e2c117..8371aee14a 100644
--- a/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin_name
Bundle-SymbolicName: org.eclipse.jgit.junit.http
-Bundle-Version: 4.6.2.qualifier
+Bundle-Version: 4.7.8.qualifier
Bundle-Localization: plugin
Bundle-Vendor: %provider_name
Bundle-ActivationPolicy: lazy
@@ -20,22 +20,23 @@ Import-Package: javax.servlet;version="[2.5.0,3.2.0)",
org.eclipse.jetty.util.component;version="[9.0.0,9.4.0)",
org.eclipse.jetty.util.log;version="[9.0.0,9.4.0)",
org.eclipse.jetty.util.security;version="[9.0.0,9.4.0)",
- org.eclipse.jgit.errors;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.http.server;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.internal.storage.file;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.junit;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lib;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.revwalk;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.transport;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.transport.resolver;version="[4.6.2,4.7.0)",
+ org.eclipse.jgit.errors;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.http.server;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.internal.storage.file;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.junit;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lib;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.revwalk;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.transport;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.transport.resolver;version="[4.7.8,4.8.0)",
org.junit;version="[4.0.0,5.0.0)"
-Export-Package: org.eclipse.jgit.junit.http;version="4.6.2";
+Export-Package: org.eclipse.jgit.junit.http;version="4.7.8";
uses:="org.eclipse.jgit.transport,
org.eclipse.jgit.junit,
javax.servlet.http,
org.eclipse.jgit.lib,
org.eclipse.jgit.revwalk,
org.eclipse.jetty.server.handler,
+ org.eclipse.jetty.security,
javax.servlet,
org.eclipse.jetty.server,
org.eclipse.jetty.util.log,
diff --git a/org.eclipse.jgit.junit.http/pom.xml b/org.eclipse.jgit.junit.http/pom.xml
index ced9c2c14f..92b7885a17 100644
--- a/org.eclipse.jgit.junit.http/pom.xml
+++ b/org.eclipse.jgit.junit.http/pom.xml
@@ -50,7 +50,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit-parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.jgit.junit.http</artifactId>
diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AccessEvent.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AccessEvent.java
index aaccc66f55..6b7853d730 100644
--- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AccessEvent.java
+++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AccessEvent.java
@@ -76,7 +76,7 @@ public class AccessEvent {
}
private static Map<String, String> cloneHeaders(final Request req) {
- Map<String, String> r = new TreeMap<String, String>();
+ Map<String, String> r = new TreeMap<>();
Enumeration hn = req.getHeaderNames();
while (hn.hasMoreElements()) {
String key = (String) hn.nextElement();
@@ -88,7 +88,7 @@ public class AccessEvent {
}
private static Map<String, String> cloneHeaders(final Response rsp) {
- Map<String, String> r = new TreeMap<String, String>();
+ Map<String, String> r = new TreeMap<>();
Enumeration<String> hn = rsp.getHttpFields().getFieldNames();
while (hn.hasMoreElements()) {
String key = hn.nextElement();
@@ -153,6 +153,7 @@ public class AccessEvent {
return responseHeaders.get(name);
}
+ @Override
public String toString() {
StringBuilder b = new StringBuilder();
b.append(method);
diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java
index 44c1977171..a66348452c 100644
--- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java
+++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java
@@ -269,7 +269,7 @@ public class AppServer {
/** @return all requests since the server was started. */
public List<AccessEvent> getRequests() {
- return new ArrayList<AccessEvent>(log.getEvents());
+ return new ArrayList<>(log.getEvents());
}
/**
@@ -289,7 +289,7 @@ public class AppServer {
* @return all requests which match the given path.
*/
public List<AccessEvent> getRequests(String path) {
- ArrayList<AccessEvent> r = new ArrayList<AccessEvent>();
+ ArrayList<AccessEvent> r = new ArrayList<>();
for (AccessEvent event : log.getEvents()) {
if (event.getPath().equals(path)) {
r.add(event);
diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/HttpTestCase.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/HttpTestCase.java
index ab5d3e1d90..1b94e02fa4 100644
--- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/HttpTestCase.java
+++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/HttpTestCase.java
@@ -74,11 +74,13 @@ public abstract class HttpTestCase extends LocalDiskRepositoryTestCase {
/** In-memory application server; subclass must start. */
protected AppServer server;
+ @Override
public void setUp() throws Exception {
super.setUp();
server = new AppServer();
}
+ @Override
public void tearDown() throws Exception {
server.tearDown();
super.tearDown();
@@ -86,7 +88,7 @@ public abstract class HttpTestCase extends LocalDiskRepositoryTestCase {
protected TestRepository<Repository> createTestRepository()
throws IOException {
- return new TestRepository<Repository>(createBareRepository());
+ return new TestRepository<>(createBareRepository());
}
protected URIish toURIish(String path) throws URISyntaxException {
@@ -118,12 +120,12 @@ public abstract class HttpTestCase extends LocalDiskRepositoryTestCase {
protected static void fsck(Repository db, RevObject... tips)
throws Exception {
TestRepository<? extends Repository> tr =
- new TestRepository<Repository>(db);
+ new TestRepository<>(db);
tr.fsck(tips);
}
protected static Set<RefSpec> mirror(String... refs) {
- HashSet<RefSpec> r = new HashSet<RefSpec>();
+ HashSet<RefSpec> r = new HashSet<>();
for (String name : refs) {
RefSpec rs = new RefSpec(name);
rs = rs.setDestination(name);
diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/MockServletConfig.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/MockServletConfig.java
index 59765890bd..9defcd9833 100644
--- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/MockServletConfig.java
+++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/MockServletConfig.java
@@ -52,33 +52,39 @@ import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
public class MockServletConfig implements ServletConfig {
- private final Map<String, String> parameters = new HashMap<String, String>();
+ private final Map<String, String> parameters = new HashMap<>();
public void setInitParameter(String name, String value) {
parameters.put(name, value);
}
+ @Override
public String getInitParameter(String name) {
return parameters.get(name);
}
+ @Override
public Enumeration<String> getInitParameterNames() {
final Iterator<String> i = parameters.keySet().iterator();
return new Enumeration<String>() {
+ @Override
public boolean hasMoreElements() {
return i.hasNext();
}
+ @Override
public String nextElement() {
return i.next();
}
};
}
+ @Override
public String getServletName() {
return "MOCK_SERVLET";
}
+ @Override
public ServletContext getServletContext() {
return null;
}
diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java
index 7600843d23..415398da26 100644
--- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java
+++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java
@@ -52,7 +52,7 @@ import org.eclipse.jetty.util.log.Logger;
/** Logs warnings into an array for later inspection. */
public class RecordingLogger implements Logger {
- private static List<Warning> warnings = new ArrayList<Warning>();
+ private static List<Warning> warnings = new ArrayList<>();
/** Clear the warnings, automatically done by {@link AppServer#setUp()} */
public static void clear() {
@@ -64,7 +64,7 @@ public class RecordingLogger implements Logger {
/** @return the warnings (if any) from the last execution */
public static List<Warning> getWarnings() {
synchronized (warnings) {
- ArrayList<Warning> copy = new ArrayList<Warning>(warnings);
+ ArrayList<Warning> copy = new ArrayList<>(warnings);
return Collections.unmodifiableList(copy);
}
}
@@ -94,10 +94,12 @@ public class RecordingLogger implements Logger {
this.name = name;
}
+ @Override
public Logger getLogger(@SuppressWarnings("hiding") String name) {
return new RecordingLogger(name);
}
+ @Override
public String getName() {
return name;
}
@@ -108,6 +110,7 @@ public class RecordingLogger implements Logger {
}
}
+ @Override
public void warn(String msg, Throwable th) {
synchronized (warnings) {
warnings.add(new Warning(msg, th));
@@ -126,6 +129,7 @@ public class RecordingLogger implements Logger {
// Ignore (not relevant to test failures)
}
+ @Override
public void debug(String msg, Throwable th) {
// Ignore (not relevant to test failures)
}
@@ -144,46 +148,56 @@ public class RecordingLogger implements Logger {
// Ignore (not relevant to test failures)
}
+ @Override
public boolean isDebugEnabled() {
return false;
}
+ @Override
public void setDebugEnabled(boolean enabled) {
// Ignore (not relevant to test failures)
}
+ @Override
public void warn(String msg, Object... args) {
synchronized (warnings) {
warnings.add(new Warning(MessageFormat.format(msg, args)));
}
}
+ @Override
public void warn(Throwable thrown) {
synchronized (warnings) {
warnings.add(new Warning(thrown));
}
}
+ @Override
public void info(String msg, Object... args) {
// Ignore (not relevant to test failures)
}
+ @Override
public void info(Throwable thrown) {
// Ignore (not relevant to test failures)
}
+ @Override
public void info(String msg, Throwable thrown) {
// Ignore (not relevant to test failures)
}
+ @Override
public void debug(String msg, Object... args) {
// Ignore (not relevant to test failures)
}
+ @Override
public void debug(Throwable thrown) {
// Ignore (not relevant to test failures)
}
+ @Override
public void ignore(Throwable arg0) {
// Ignore (not relevant to test failures)
}
diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/SimpleHttpServer.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/SimpleHttpServer.java
index e550e6c567..605c69a844 100644
--- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/SimpleHttpServer.java
+++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/SimpleHttpServer.java
@@ -92,6 +92,7 @@ public class SimpleHttpServer {
private ServletContextHandler smart(final String path) {
GitServlet gs = new GitServlet();
gs.setRepositoryResolver(new RepositoryResolver<HttpServletRequest>() {
+ @Override
public Repository open(HttpServletRequest req, String name)
throws RepositoryNotFoundException,
ServiceNotEnabledException {
diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/TestRequestLog.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/TestRequestLog.java
index 14ea03a921..c218c07a6c 100644
--- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/TestRequestLog.java
+++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/TestRequestLog.java
@@ -61,7 +61,7 @@ import org.eclipse.jetty.server.handler.HandlerWrapper;
class TestRequestLog extends HandlerWrapper {
private static final int MAX = 16;
- private final List<AccessEvent> events = new ArrayList<AccessEvent>();
+ private final List<AccessEvent> events = new ArrayList<>();
private final Semaphore active = new Semaphore(MAX);
diff --git a/org.eclipse.jgit.junit/.settings/.api_filters b/org.eclipse.jgit.junit/.settings/.api_filters
new file mode 100644
index 0000000000..a70ce77e1b
--- /dev/null
+++ b/org.eclipse.jgit.junit/.settings/.api_filters
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<component id="org.eclipse.jgit.junit" version="2">
+ <resource path="src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java" type="org.eclipse.jgit.junit.LocalDiskRepositoryTestCase">
+ <filter comment="OK to use internal implementation in tests" id="643842064">
+ <message_arguments>
+ <message_argument value="FileRepository"/>
+ <message_argument value="LocalDiskRepositoryTestCase"/>
+ <message_argument value="createBareRepository()"/>
+ </message_arguments>
+ </filter>
+ <filter comment="OK to use internal implementation in tests" id="643842064">
+ <message_arguments>
+ <message_argument value="FileRepository"/>
+ <message_argument value="LocalDiskRepositoryTestCase"/>
+ <message_argument value="createRepository(boolean, boolean)"/>
+ </message_arguments>
+ </filter>
+ <filter comment="OK to use internal implementation in tests" id="643842064">
+ <message_arguments>
+ <message_argument value="FileRepository"/>
+ <message_argument value="LocalDiskRepositoryTestCase"/>
+ <message_argument value="createWorkRepository()"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/jgit/junit/RepositoryTestCase.java" type="org.eclipse.jgit.junit.RepositoryTestCase">
+ <filter comment="OK to use internal implementation in tests" id="627060751">
+ <message_arguments>
+ <message_argument value="FileRepository"/>
+ <message_argument value="RepositoryTestCase"/>
+ <message_argument value="db"/>
+ </message_arguments>
+ </filter>
+ </resource>
+</component>
diff --git a/org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs
index 10c29d5576..64f74989e1 100644
--- a/org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs
@@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -76,7 +76,7 @@ org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
diff --git a/org.eclipse.jgit.junit/BUCK b/org.eclipse.jgit.junit/BUCK
deleted file mode 100644
index 7e2543220a..0000000000
--- a/org.eclipse.jgit.junit/BUCK
+++ /dev/null
@@ -1,10 +0,0 @@
-java_library(
- name = 'junit',
- srcs = glob(['src/**']),
- resources = glob(['resources/**']),
- provided_deps = [
- '//org.eclipse.jgit:jgit',
- '//lib:junit',
- ],
- visibility = ['PUBLIC'],
-)
diff --git a/org.eclipse.jgit.junit/BUILD b/org.eclipse.jgit.junit/BUILD
new file mode 100644
index 0000000000..350b25f97d
--- /dev/null
+++ b/org.eclipse.jgit.junit/BUILD
@@ -0,0 +1,14 @@
+package(default_visibility = ["//visibility:public"])
+
+java_library(
+ name = "junit",
+ testonly = 1,
+ srcs = glob(["src/**"]),
+ resource_strip_prefix = "org.eclipse.jgit.junit/resources",
+ resources = glob(["resources/**"]),
+ deps = [
+ "//lib:junit",
+ # We want these deps to be provided_deps
+ "//org.eclipse.jgit:jgit",
+ ],
+)
diff --git a/org.eclipse.jgit.junit/META-INF/MANIFEST.MF b/org.eclipse.jgit.junit/META-INF/MANIFEST.MF
index 9de6239890..4c3f91a2cb 100644
--- a/org.eclipse.jgit.junit/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.junit/META-INF/MANIFEST.MF
@@ -2,31 +2,31 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin_name
Bundle-SymbolicName: org.eclipse.jgit.junit
-Bundle-Version: 4.6.2.qualifier
+Bundle-Version: 4.7.8.qualifier
Bundle-Localization: plugin
Bundle-Vendor: %provider_name
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Import-Package: org.eclipse.jgit.api;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.api.errors;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.dircache;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.errors;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.internal.storage.file;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.internal.storage.pack;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lib;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.merge;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.revwalk;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.storage.file;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.treewalk;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.treewalk.filter;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.util;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.util.io;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.util.time;version="[4.6.2,4.7.0)",
+Import-Package: org.eclipse.jgit.api;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.api.errors;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.dircache;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.errors;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.internal.storage.file;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.internal.storage.pack;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lib;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.merge;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.revwalk;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.storage.file;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.treewalk;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.treewalk.filter;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.util;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.util.io;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.util.time;version="[4.7.8,4.8.0)",
org.junit;version="[4.0.0,5.0.0)",
org.junit.rules;version="[4.9.0,5.0.0)",
org.junit.runner;version="[4.0.0,5.0.0)",
org.junit.runners.model;version="[4.5.0,5.0.0)"
-Export-Package: org.eclipse.jgit.junit;version="4.6.2";
+Export-Package: org.eclipse.jgit.junit;version="4.7.8";
uses:="org.eclipse.jgit.dircache,
org.eclipse.jgit.lib,
org.eclipse.jgit.revwalk,
@@ -35,4 +35,4 @@ Export-Package: org.eclipse.jgit.junit;version="4.6.2";
org.eclipse.jgit.util,
org.eclipse.jgit.storage.file,
org.eclipse.jgit.api",
- org.eclipse.jgit.junit.time;version="4.6.2"
+ org.eclipse.jgit.junit.time;version="4.7.8"
diff --git a/org.eclipse.jgit.junit/pom.xml b/org.eclipse.jgit.junit/pom.xml
index ab757afd9a..95af04523b 100644
--- a/org.eclipse.jgit.junit/pom.xml
+++ b/org.eclipse.jgit.junit/pom.xml
@@ -52,7 +52,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit-parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.jgit.junit</artifactId>
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
index dc2e8bfb71..6ace9fc122 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
@@ -53,13 +53,16 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.TreeSet;
import org.eclipse.jgit.dircache.DirCache;
import org.eclipse.jgit.dircache.DirCacheEntry;
import org.eclipse.jgit.internal.storage.file.FileRepository;
+import org.eclipse.jgit.lib.ConfigConstants;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.PersonIdent;
@@ -106,7 +109,7 @@ public abstract class LocalDiskRepositoryTestCase {
*/
protected MockSystemReader mockSystemReader;
- private final List<Repository> toClose = new ArrayList<Repository>();
+ private final Set<Repository> toClose = new HashSet<>();
private File tmp;
@Before
@@ -119,6 +122,12 @@ public abstract class LocalDiskRepositoryTestCase {
mockSystemReader = new MockSystemReader();
mockSystemReader.userGitConfig = new FileBasedConfig(new File(tmp,
"usergitconfig"), FS.DETECTED);
+ // We have to set autoDetach to false for tests, because tests expect to be able
+ // to clean up by recursively removing the repository, and background GC might be
+ // in the middle of writing or deleting files, which would disrupt this.
+ mockSystemReader.userGitConfig.setBoolean(ConfigConstants.CONFIG_GC_SECTION,
+ null, ConfigConstants.CONFIG_KEY_AUTODETACH, false);
+ mockSystemReader.userGitConfig.save();
ceilTestDirectories(getCeilings());
SystemReader.setInstance(mockSystemReader);
@@ -284,7 +293,7 @@ public abstract class LocalDiskRepositoryTestCase {
throws IllegalStateException, IOException {
DirCache dc = repo.readDirCache();
StringBuilder sb = new StringBuilder();
- TreeSet<Long> timeStamps = new TreeSet<Long>();
+ TreeSet<Long> timeStamps = new TreeSet<>();
// iterate once over the dircache just to collect all time stamps
if (0 != (includedOptions & MOD_TIME)) {
@@ -357,12 +366,32 @@ public abstract class LocalDiskRepositoryTestCase {
* @throws IOException
* the repository could not be created in the temporary area
*/
- private FileRepository createRepository(boolean bare) throws IOException {
+ private FileRepository createRepository(boolean bare)
+ throws IOException {
+ return createRepository(bare, true /* auto close */);
+ }
+
+ /**
+ * Creates a new empty repository.
+ *
+ * @param bare
+ * true to create a bare repository; false to make a repository
+ * within its working directory
+ * @param autoClose
+ * auto close the repository in #tearDown
+ * @return the newly created repository, opened for access
+ * @throws IOException
+ * the repository could not be created in the temporary area
+ */
+ public FileRepository createRepository(boolean bare, boolean autoClose)
+ throws IOException {
File gitdir = createUniqueTestGitDir(bare);
FileRepository db = new FileRepository(gitdir);
assertFalse(gitdir.exists());
db.create(bare);
- toClose.add(db);
+ if (autoClose) {
+ addRepoToClose(db);
+ }
return db;
}
@@ -530,7 +559,7 @@ public abstract class LocalDiskRepositoryTestCase {
}
private static HashMap<String, String> cloneEnv() {
- return new HashMap<String, String>(System.getenv());
+ return new HashMap<>(System.getenv());
}
private static final class CleanupThread extends Thread {
@@ -552,7 +581,7 @@ public abstract class LocalDiskRepositoryTestCase {
}
}
- private final List<File> toDelete = new ArrayList<File>();
+ private final List<File> toDelete = new ArrayList<>();
@Override
public void run() {
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java
index 6faa2ece48..68482c6c27 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java
@@ -88,7 +88,7 @@ public class MockSystemReader extends SystemReader {
long now = 1250379778668L; // Sat Aug 15 20:12:58 GMT-03:30 2009
- final Map<String, String> values = new HashMap<String, String>();
+ final Map<String, String> values = new HashMap<>();
FileBasedConfig userGitConfig;
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 a44e999378..d1358ee2a5 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
@@ -876,7 +876,7 @@ public class TestRepository<R extends Repository> {
final File pack, idx;
try (PackWriter pw = new PackWriter(db)) {
- Set<ObjectId> all = new HashSet<ObjectId>();
+ Set<ObjectId> all = new HashSet<>();
for (Ref r : db.getAllRefs().values())
all.add(r.getObjectId());
pw.preparePack(m, all, PackWriter.NONE);
@@ -992,7 +992,7 @@ public class TestRepository<R extends Repository> {
private ObjectId topLevelTree;
- private final List<RevCommit> parents = new ArrayList<RevCommit>(2);
+ private final List<RevCommit> parents = new ArrayList<>(2);
private int tick = 1;
diff --git a/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs
index 10c29d5576..64f74989e1 100644
--- a/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs
@@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -76,7 +76,7 @@ org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
diff --git a/org.eclipse.jgit.lfs.server.test/BUCK b/org.eclipse.jgit.lfs.server.test/BUCK
deleted file mode 100644
index 25e9f09c18..0000000000
--- a/org.eclipse.jgit.lfs.server.test/BUCK
+++ /dev/null
@@ -1,34 +0,0 @@
-TEST_BASE = ['tst/org/eclipse/jgit/lfs/server/fs/LfsServerTest.java']
-TESTS = glob(['tst/**/*.java'],
- excludes = TEST_BASE
-)
-
-for t in TESTS:
- n = t[len('tst/'):len(t)-len('.java')].replace('/', '.')
- java_test(
- name = n,
- labels = ['lfs-server'],
- srcs = [t] + TEST_BASE,
- deps = [
- '//org.eclipse.jgit.lfs.test:helpers',
- '//org.eclipse.jgit:jgit',
- '//org.eclipse.jgit.junit:junit',
- '//org.eclipse.jgit.junit.http:junit-http',
- '//org.eclipse.jgit.lfs:jgit-lfs',
- '//org.eclipse.jgit.lfs.server:jgit-lfs-server',
- '//lib:hamcrest-core',
- '//lib:hamcrest-library',
- '//lib:httpcore',
- '//lib:httpcomponents',
- '//lib:junit',
- '//lib/jetty:http',
- '//lib/jetty:io',
- '//lib/jetty:server',
- '//lib/jetty:servlet',
- '//lib/jetty:security',
- '//lib/jetty:util',
- '//lib:servlet-api',
- '//lib:commons-logging',
- ],
- vm_args = ['-Xmx256m', '-Dfile.encoding=UTF-8'],
- )
diff --git a/org.eclipse.jgit.lfs.server.test/BUILD b/org.eclipse.jgit.lfs.server.test/BUILD
new file mode 100644
index 0000000000..1341dd6011
--- /dev/null
+++ b/org.eclipse.jgit.lfs.server.test/BUILD
@@ -0,0 +1,49 @@
+load(
+ "@com_googlesource_gerrit_bazlets//tools:junit.bzl",
+ "junit_tests",
+)
+
+TEST_BASE = ["tst/org/eclipse/jgit/lfs/server/fs/LfsServerTest.java"]
+
+DEPS = [
+ "//org.eclipse.jgit.lfs.test:helpers",
+ "//org.eclipse.jgit:jgit",
+ "//org.eclipse.jgit.junit:junit",
+ "//org.eclipse.jgit.junit.http:junit-http",
+ "//org.eclipse.jgit.lfs:jgit-lfs",
+ "//org.eclipse.jgit.lfs.server:jgit-lfs-server",
+ "//lib:commons-logging",
+ "//lib:httpcore",
+ "//lib:httpclient",
+ "//lib:junit",
+ "//lib:jetty-http",
+ "//lib:jetty-io",
+ "//lib:jetty-server",
+ "//lib:jetty-servlet",
+ "//lib:jetty-security",
+ "//lib:jetty-util",
+ "//lib:servlet-api",
+]
+
+junit_tests(
+ name = "lfs_server",
+ srcs = glob(
+ ["tst/**/*.java"],
+ exclude = TEST_BASE,
+ ),
+ jvm_flags = [
+ "-Xmx256m",
+ "-Dfile.encoding=UTF-8",
+ ],
+ tags = ["lfs-server"],
+ deps = DEPS + [
+ ":helpers",
+ ],
+)
+
+java_library(
+ name = "helpers",
+ testonly = 1,
+ srcs = TEST_BASE,
+ deps = DEPS,
+)
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 405e07a725..0304aaaf0e 100644
--- a/org.eclipse.jgit.lfs.server.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.lfs.server.test/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin_name
Bundle-SymbolicName: org.eclipse.jgit.lfs.server.test
-Bundle-Version: 4.6.2.qualifier
+Bundle-Version: 4.7.8.qualifier
Bundle-Vendor: %provider_name
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
@@ -27,11 +27,11 @@ Import-Package: javax.servlet;version="[3.1.0,4.0.0)",
org.eclipse.jetty.util.log;version="[9.0.0,9.4.0)",
org.eclipse.jetty.util.security;version="[9.0.0,9.4.0)",
org.eclipse.jetty.util.thread;version="[9.0.0,9.4.0)",
- org.eclipse.jgit.junit.http;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lfs.lib;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lfs.server.fs;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lfs.test;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.util;version="[4.6.2,4.7.0)",
+ org.eclipse.jgit.junit.http;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lfs.lib;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lfs.server.fs;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lfs.test;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.util;version="[4.7.8,4.8.0)",
org.hamcrest.core;version="[1.1.0,2.0.0)",
org.junit;version="[4.0.0,5.0.0)",
org.junit.runner;version="[4.0.0,5.0.0)",
diff --git a/org.eclipse.jgit.lfs.server.test/pom.xml b/org.eclipse.jgit.lfs.server.test/pom.xml
index d178feff68..792a3107c7 100644
--- a/org.eclipse.jgit.lfs.server.test/pom.xml
+++ b/org.eclipse.jgit.lfs.server.test/pom.xml
@@ -50,7 +50,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit-parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.jgit.lfs.server.test</artifactId>
diff --git a/org.eclipse.jgit.lfs.server/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.lfs.server/.settings/org.eclipse.jdt.core.prefs
index 808ec3a2c6..ede0f7d55d 100644
--- a/org.eclipse.jgit.lfs.server/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.lfs.server/.settings/org.eclipse.jdt.core.prefs
@@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -76,7 +76,7 @@ org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
diff --git a/org.eclipse.jgit.lfs.server/BUCK b/org.eclipse.jgit.lfs.server/BUCK
deleted file mode 100644
index 6b40b7c127..0000000000
--- a/org.eclipse.jgit.lfs.server/BUCK
+++ /dev/null
@@ -1,22 +0,0 @@
-SRCS = glob(['src/**'])
-RESOURCES = glob(['resources/**'])
-
-java_library(
- name = 'jgit-lfs-server',
- srcs = SRCS,
- resources = RESOURCES,
- deps = [
- '//org.eclipse.jgit.http.apache:http-apache',
- '//org.eclipse.jgit:jgit',
- '//org.eclipse.jgit.lfs:jgit-lfs',
- '//lib:gson',
- '//lib:httpcore',
- '//lib:servlet-api'
- ],
- visibility = ['PUBLIC'],
-)
-
-java_sources(
- name = 'jgit-lfs-server_src',
- srcs = SRCS + RESOURCES,
-)
diff --git a/org.eclipse.jgit.lfs.server/BUILD b/org.eclipse.jgit.lfs.server/BUILD
new file mode 100644
index 0000000000..fa14e8a206
--- /dev/null
+++ b/org.eclipse.jgit.lfs.server/BUILD
@@ -0,0 +1,17 @@
+package(default_visibility = ["//visibility:public"])
+
+java_library(
+ name = "jgit-lfs-server",
+ srcs = glob(["src/**"]),
+ resource_strip_prefix = "org.eclipse.jgit.lfs.server/resources",
+ resources = glob(["resources/**"]),
+ deps = [
+ "//lib:gson",
+ "//lib:httpcore",
+ "//lib:servlet-api",
+ "//lib:slf4j-api",
+ "//org.eclipse.jgit.http.apache:http-apache",
+ "//org.eclipse.jgit:jgit",
+ "//org.eclipse.jgit.lfs:jgit-lfs",
+ ],
+)
diff --git a/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF b/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF
index 3e8a9d17cd..826e02fae8 100644
--- a/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF
@@ -2,19 +2,19 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin_name
Bundle-SymbolicName: org.eclipse.jgit.lfs.server
-Bundle-Version: 4.6.2.qualifier
+Bundle-Version: 4.7.8.qualifier
Bundle-Localization: plugin
Bundle-Vendor: %provider_name
-Export-Package: org.eclipse.jgit.lfs.server;version="4.6.2";
+Export-Package: org.eclipse.jgit.lfs.server;version="4.7.8";
uses:="javax.servlet.http,
org.eclipse.jgit.lfs.lib",
- org.eclipse.jgit.lfs.server.fs;version="4.6.2";
+ org.eclipse.jgit.lfs.server.fs;version="4.7.8";
uses:="javax.servlet,
javax.servlet.http,
org.eclipse.jgit.lfs.server,
org.eclipse.jgit.lfs.lib",
- org.eclipse.jgit.lfs.server.internal;version="4.6.2";x-internal:=true,
- org.eclipse.jgit.lfs.server.s3;version="4.6.2";
+ org.eclipse.jgit.lfs.server.internal;version="4.7.8";x-internal:=true,
+ org.eclipse.jgit.lfs.server.s3;version="4.7.8";
uses:="org.eclipse.jgit.lfs.server,
org.eclipse.jgit.lfs.lib"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
@@ -24,13 +24,14 @@ Import-Package: com.google.gson;version="[2.2.4,3.0.0)",
javax.servlet.http;version="[3.1.0,4.0.0)",
org.apache.http;version="[4.3.0,5.0.0)",
org.apache.http.client;version="[4.3.0,5.0.0)",
- org.eclipse.jgit.annotations;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.internal;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.internal.storage.file;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lfs.errors;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lfs.internal;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lfs.lib;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.nls;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.transport.http;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.transport.http.apache;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.util;version="[4.6.2,4.7.0)"
+ org.eclipse.jgit.annotations;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.internal;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.internal.storage.file;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lfs.errors;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lfs.internal;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lfs.lib;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.nls;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.transport.http;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.transport.http.apache;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.util;version="[4.7.8,4.8.0)",
+ org.slf4j;version="[1.7.0,2.0.0)"
diff --git a/org.eclipse.jgit.lfs.server/pom.xml b/org.eclipse.jgit.lfs.server/pom.xml
index cc84686810..3cdb144199 100644
--- a/org.eclipse.jgit.lfs.server/pom.xml
+++ b/org.eclipse.jgit.lfs.server/pom.xml
@@ -50,7 +50,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit-parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.jgit.lfs.server</artifactId>
diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/LfsProtocolServlet.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/LfsProtocolServlet.java
index 841074beeb..2473dcdc8c 100644
--- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/LfsProtocolServlet.java
+++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/LfsProtocolServlet.java
@@ -49,7 +49,12 @@ import static org.apache.http.HttpStatus.SC_INTERNAL_SERVER_ERROR;
import static org.apache.http.HttpStatus.SC_NOT_FOUND;
import static org.apache.http.HttpStatus.SC_OK;
import static org.apache.http.HttpStatus.SC_SERVICE_UNAVAILABLE;
+import static org.apache.http.HttpStatus.SC_UNAUTHORIZED;
import static org.apache.http.HttpStatus.SC_UNPROCESSABLE_ENTITY;
+import static org.eclipse.jgit.lfs.lib.Constants.DOWNLOAD;
+import static org.eclipse.jgit.lfs.lib.Constants.UPLOAD;
+import static org.eclipse.jgit.lfs.lib.Constants.VERIFY;
+import static org.eclipse.jgit.util.HttpSupport.HDR_AUTHORIZATION;
import java.io.BufferedReader;
import java.io.BufferedWriter;
@@ -58,6 +63,7 @@ import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;
+import java.text.MessageFormat;
import java.util.List;
import javax.servlet.ServletException;
@@ -71,8 +77,12 @@ import org.eclipse.jgit.lfs.errors.LfsInsufficientStorage;
import org.eclipse.jgit.lfs.errors.LfsRateLimitExceeded;
import org.eclipse.jgit.lfs.errors.LfsRepositoryNotFound;
import org.eclipse.jgit.lfs.errors.LfsRepositoryReadOnly;
+import org.eclipse.jgit.lfs.errors.LfsUnauthorized;
import org.eclipse.jgit.lfs.errors.LfsUnavailable;
import org.eclipse.jgit.lfs.errors.LfsValidationError;
+import org.eclipse.jgit.lfs.internal.LfsText;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
@@ -86,6 +96,8 @@ import com.google.gson.GsonBuilder;
* @since 4.3
*/
public abstract class LfsProtocolServlet extends HttpServlet {
+ private static Logger LOG = LoggerFactory
+ .getLogger(LfsProtocolServlet.class);
private static final long serialVersionUID = 1L;
@@ -132,9 +144,54 @@ public abstract class LfsProtocolServlet extends HttpServlet {
* <dd>when an unexpected internal server error occurred</dd>
* </dl>
* @since 4.5
+ * @deprecated use
+ * {@link #getLargeFileRepository(LfsRequest, String, String)}
+ */
+ @Deprecated
+ protected LargeFileRepository getLargeFileRepository(LfsRequest request,
+ String path) throws LfsException {
+ return getLargeFileRepository(request, path, null);
+ }
+
+ /**
+ * Get the large file repository for the given request and path.
+ *
+ * @param request
+ * the request
+ * @param path
+ * the path
+ * @param auth
+ * the Authorization HTTP header
+ *
+ * @return the large file repository storing large files.
+ * @throws LfsException
+ * implementations should throw more specific exceptions to
+ * signal which type of error occurred:
+ * <dl>
+ * <dt>{@link LfsValidationError}</dt>
+ * <dd>when there is a validation error with one or more of the
+ * objects in the request</dd>
+ * <dt>{@link LfsRepositoryNotFound}</dt>
+ * <dd>when the repository does not exist for the user</dd>
+ * <dt>{@link LfsRepositoryReadOnly}</dt>
+ * <dd>when the user has read, but not write access. Only
+ * applicable when the operation in the request is "upload"</dd>
+ * <dt>{@link LfsRateLimitExceeded}</dt>
+ * <dd>when the user has hit a rate limit with the server</dd>
+ * <dt>{@link LfsBandwidthLimitExceeded}</dt>
+ * <dd>when the bandwidth limit for the user or repository has
+ * been exceeded</dd>
+ * <dt>{@link LfsInsufficientStorage}</dt>
+ * <dd>when there is insufficient storage on the server</dd>
+ * <dt>{@link LfsUnavailable}</dt>
+ * <dd>when LFS is not available</dd>
+ * <dt>{@link LfsException}</dt>
+ * <dd>when an unexpected internal server error occurred</dd>
+ * </dl>
+ * @since 4.7
*/
protected abstract LargeFileRepository getLargeFileRepository(
- LfsRequest request, String path) throws LfsException;
+ LfsRequest request, String path, String auth) throws LfsException;
/**
* LFS request.
@@ -163,6 +220,30 @@ public abstract class LfsProtocolServlet extends HttpServlet {
public List<LfsObject> getObjects() {
return objects;
}
+
+ /**
+ * @return true if the operation is upload.
+ * @since 4.7
+ */
+ public boolean isUpload() {
+ return operation.equals(UPLOAD);
+ }
+
+ /**
+ * @return true if the operation is download.
+ * @since 4.7
+ */
+ public boolean isDownload() {
+ return operation.equals(DOWNLOAD);
+ }
+
+ /**
+ * @return true if the operation is verify.
+ * @since 4.7
+ */
+ public boolean isVerify() {
+ return operation.equals(VERIFY);
+ }
}
@Override
@@ -179,9 +260,13 @@ public abstract class LfsProtocolServlet extends HttpServlet {
res.setContentType(CONTENTTYPE_VND_GIT_LFS_JSON);
LargeFileRepository repo = null;
try {
- repo = getLargeFileRepository(request, path);
+ repo = getLargeFileRepository(request, path,
+ req.getHeader(HDR_AUTHORIZATION));
if (repo == null) {
- throw new LfsException("unexpected error"); //$NON-NLS-1$
+ String error = MessageFormat
+ .format(LfsText.get().lfsFailedToGetRepository, path);
+ LOG.error(error);
+ throw new LfsException(error);
}
res.setStatus(SC_OK);
TransferHandler handler = TransferHandler
@@ -201,6 +286,8 @@ public abstract class LfsProtocolServlet extends HttpServlet {
sendError(res, w, SC_INSUFFICIENT_STORAGE, e.getMessage());
} catch (LfsUnavailable e) {
sendError(res, w, SC_SERVICE_UNAVAILABLE, e.getMessage());
+ } catch (LfsUnauthorized e) {
+ sendError(res, w, SC_UNAUTHORIZED, e.getMessage());
} catch (LfsException e) {
sendError(res, w, SC_INTERNAL_SERVER_ERROR, e.getMessage());
} finally {
diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/TransferHandler.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/TransferHandler.java
index bf5b61cc6e..86ca2d38b8 100644
--- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/TransferHandler.java
+++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/TransferHandler.java
@@ -44,6 +44,9 @@
package org.eclipse.jgit.lfs.server;
import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND;
+import static org.eclipse.jgit.lfs.lib.Constants.DOWNLOAD;
+import static org.eclipse.jgit.lfs.lib.Constants.UPLOAD;
+import static org.eclipse.jgit.lfs.lib.Constants.VERIFY;
import java.io.IOException;
import java.text.MessageFormat;
@@ -58,18 +61,14 @@ import org.eclipse.jgit.lfs.server.internal.LfsServerText;
abstract class TransferHandler {
- private static final String DOWNLOAD = "download"; //$NON-NLS-1$
- private static final String UPLOAD = "upload"; //$NON-NLS-1$
- private static final String VERIFY = "verify"; //$NON-NLS-1$
-
static TransferHandler forOperation(String operation,
LargeFileRepository repository, List<LfsObject> objects) {
switch (operation) {
- case TransferHandler.UPLOAD:
+ case UPLOAD:
return new Upload(repository, objects);
- case TransferHandler.DOWNLOAD:
+ case DOWNLOAD:
return new Download(repository, objects);
- case TransferHandler.VERIFY:
+ case VERIFY:
default:
throw new UnsupportedOperationException(MessageFormat.format(
LfsServerText.get().unsupportedOperation, operation));
diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsServlet.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsServlet.java
index a8e3c11e27..15c4448da8 100644
--- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsServlet.java
+++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsServlet.java
@@ -202,6 +202,11 @@ public class FileLfsServlet extends HttpServlet {
*/
protected static void sendError(HttpServletResponse rsp, int status, String message)
throws IOException {
+ if (rsp.isCommitted()) {
+ rsp.getOutputStream().close();
+ return;
+ }
+ rsp.reset();
rsp.setStatus(status);
PrintWriter writer = rsp.getWriter();
gson.toJson(new Error(message), writer);
diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectDownloadListener.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectDownloadListener.java
index f179b6cc5e..a76f7ef0d8 100644
--- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectDownloadListener.java
+++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectDownloadListener.java
@@ -61,9 +61,11 @@ import org.eclipse.jgit.lfs.lib.Constants;
import org.eclipse.jgit.util.HttpSupport;
/**
- * Handle asynchronous large object download
+ * Handle asynchronous large object download.
+ *
+ * @since 4.7
*/
-class ObjectDownloadListener implements WriteListener {
+public class ObjectDownloadListener implements WriteListener {
private static Logger LOG = Logger
.getLogger(ObjectDownloadListener.class.getName());
@@ -78,7 +80,7 @@ class ObjectDownloadListener implements WriteListener {
private final WritableByteChannel outChannel;
- private final ByteBuffer buffer = ByteBuffer.allocateDirect(8192);
+ private ByteBuffer buffer = ByteBuffer.allocateDirect(8192);
/**
* @param repository
@@ -113,19 +115,35 @@ class ObjectDownloadListener implements WriteListener {
@Override
public void onWritePossible() throws IOException {
while (out.isReady()) {
- if (in.read(buffer) != -1) {
- buffer.flip();
- outChannel.write(buffer);
- buffer.compact();
- } else {
- in.close();
- buffer.flip();
- while (out.isReady()) {
- if (buffer.hasRemaining()) {
- outChannel.write(buffer);
- } else {
+ try {
+ buffer.clear();
+ if (in.read(buffer) < 0) {
+ buffer = null;
+ } else {
+ buffer.flip();
+ }
+ } catch (Throwable t) {
+ LOG.log(Level.SEVERE, t.getMessage(), t);
+ buffer = null;
+ } finally {
+ if (buffer != null) {
+ outChannel.write(buffer);
+ } else {
+ try {
+ in.close();
+ } catch (IOException e) {
+ LOG.log(Level.SEVERE, e.getMessage(), e);
+ }
+ try {
+ out.close();
+ } finally {
context.complete();
}
+ // This is need to avoid endless loop in recent Jetty versions.
+ // That's because out.isReady() is returning true for already
+ // closed streams and because out.close() doesn't throw any
+ // exception any more when trying to close already closed stream.
+ return;
}
}
}
diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectUploadListener.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectUploadListener.java
index 84e4e6f1c6..da86880472 100644
--- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectUploadListener.java
+++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectUploadListener.java
@@ -150,7 +150,9 @@ public class ObjectUploadListener implements ReadListener {
channel.close();
// TODO check if status 200 is ok for PUT request, HTTP foresees 204
// for successful PUT without response body
- response.setStatus(HttpServletResponse.SC_OK);
+ if (!response.isCommitted()) {
+ response.setStatus(HttpServletResponse.SC_OK);
+ }
} finally {
context.complete();
}
diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/S3Repository.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/S3Repository.java
index c229758d43..ed896adff2 100644
--- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/S3Repository.java
+++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/S3Repository.java
@@ -94,10 +94,10 @@ public class S3Repository implements LargeFileRepository {
@Override
public Response.Action getDownloadAction(AnyLongObjectId oid) {
URL endpointUrl = getObjectUrl(oid);
- Map<String, String> queryParams = new HashMap<String, String>();
+ Map<String, String> queryParams = new HashMap<>();
queryParams.put(X_AMZ_EXPIRES,
Integer.toString(s3Config.getExpirationSeconds()));
- Map<String, String> headers = new HashMap<String, String>();
+ Map<String, String> headers = new HashMap<>();
String authorizationQueryParameters = SignerV4.createAuthorizationQuery(
s3Config, endpointUrl, METHOD_GET, headers, queryParams,
UNSIGNED_PAYLOAD);
@@ -111,7 +111,7 @@ public class S3Repository implements LargeFileRepository {
public Response.Action getUploadAction(AnyLongObjectId oid, long size) {
cacheObjectMetaData(oid, size);
URL objectUrl = getObjectUrl(oid);
- Map<String, String> headers = new HashMap<String, String>();
+ Map<String, String> headers = new HashMap<>();
headers.put(X_AMZ_CONTENT_SHA256, oid.getName());
headers.put(HDR_CONTENT_LENGTH, Long.toString(size));
headers.put(X_AMZ_STORAGE_CLASS, s3Config.getStorageClass());
@@ -134,10 +134,10 @@ public class S3Repository implements LargeFileRepository {
@Override
public long getSize(AnyLongObjectId oid) throws IOException {
URL endpointUrl = getObjectUrl(oid);
- Map<String, String> queryParams = new HashMap<String, String>();
+ Map<String, String> queryParams = new HashMap<>();
queryParams.put(X_AMZ_EXPIRES,
Integer.toString(s3Config.getExpirationSeconds()));
- Map<String, String> headers = new HashMap<String, String>();
+ Map<String, String> headers = new HashMap<>();
String authorizationQueryParameters = SignerV4.createAuthorizationQuery(
s3Config, endpointUrl, METHOD_HEAD, headers, queryParams,
diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java
index f95b605c85..a9b0ec46e4 100644
--- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java
+++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java
@@ -57,6 +57,7 @@ import java.util.Collections;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.SimpleTimeZone;
import java.util.SortedMap;
@@ -239,7 +240,7 @@ class SignerV4 {
private static String canonicalizeHeaderNames(
Map<String, String> headers) {
- List<String> sortedHeaders = new ArrayList<String>();
+ List<String> sortedHeaders = new ArrayList<>();
sortedHeaders.addAll(headers.keySet());
Collections.sort(sortedHeaders, String.CASE_INSENSITIVE_ORDER);
@@ -247,7 +248,7 @@ class SignerV4 {
for (String header : sortedHeaders) {
if (buffer.length() > 0)
buffer.append(";"); //$NON-NLS-1$
- buffer.append(header.toLowerCase());
+ buffer.append(header.toLowerCase(Locale.ROOT));
}
return buffer.toString();
@@ -259,13 +260,14 @@ class SignerV4 {
return ""; //$NON-NLS-1$
}
- List<String> sortedHeaders = new ArrayList<String>();
+ List<String> sortedHeaders = new ArrayList<>();
sortedHeaders.addAll(headers.keySet());
Collections.sort(sortedHeaders, String.CASE_INSENSITIVE_ORDER);
StringBuilder buffer = new StringBuilder();
for (String key : sortedHeaders) {
- buffer.append(key.toLowerCase().replaceAll("\\s+", " ") + ":" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ buffer.append(
+ key.toLowerCase(Locale.ROOT).replaceAll("\\s+", " ") + ":" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ headers.get(key).replaceAll("\\s+", " ")); //$NON-NLS-1$//$NON-NLS-2$
buffer.append("\n"); //$NON-NLS-1$
}
@@ -303,7 +305,7 @@ class SignerV4 {
return ""; //$NON-NLS-1$
}
- SortedMap<String, String> sorted = new TreeMap<String, String>();
+ SortedMap<String, String> sorted = new TreeMap<>();
Iterator<Map.Entry<String, String>> pairs = parameters.entrySet()
.iterator();
diff --git a/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs
index 10c29d5576..64f74989e1 100644
--- a/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs
@@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -76,7 +76,7 @@ org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
diff --git a/org.eclipse.jgit.lfs.test/BUCK b/org.eclipse.jgit.lfs.test/BUCK
deleted file mode 100644
index 1298e166c0..0000000000
--- a/org.eclipse.jgit.lfs.test/BUCK
+++ /dev/null
@@ -1,30 +0,0 @@
-TESTS = glob(['tst/**/*.java'])
-
-for t in TESTS:
- n = t[len('tst/'):len(t)-len('.java')].replace('/', '.')
- java_test(
- name = n,
- labels = ['lfs'],
- srcs = [t],
- deps = [
- ':helpers',
- '//org.eclipse.jgit.junit:junit',
- '//org.eclipse.jgit.lfs:jgit-lfs',
- '//org.eclipse.jgit:jgit',
- '//lib:hamcrest-core',
- '//lib:hamcrest-library',
- '//lib:junit',
- ],
- )
-
-java_library(
- name = 'helpers',
- srcs = glob(['src/**/*.java']),
- deps = [
- '//org.eclipse.jgit:jgit',
- '//org.eclipse.jgit.lfs:jgit-lfs',
- '//org.eclipse.jgit.junit:junit',
- '//lib:junit',
- ],
- visibility = ['PUBLIC']
-)
diff --git a/org.eclipse.jgit.lfs.test/BUILD b/org.eclipse.jgit.lfs.test/BUILD
new file mode 100644
index 0000000000..213ba57947
--- /dev/null
+++ b/org.eclipse.jgit.lfs.test/BUILD
@@ -0,0 +1,31 @@
+package(default_visibility = ["//visibility:public"])
+
+load(
+ "@com_googlesource_gerrit_bazlets//tools:junit.bzl",
+ "junit_tests",
+)
+
+junit_tests(
+ name = "lfs",
+ srcs = glob(["tst/**/*.java"]),
+ tags = ["lfs"],
+ deps = [
+ ":helpers",
+ "//lib:junit",
+ "//org.eclipse.jgit:jgit",
+ "//org.eclipse.jgit.junit:junit",
+ "//org.eclipse.jgit.lfs:jgit-lfs",
+ ],
+)
+
+java_library(
+ name = "helpers",
+ testonly = 1,
+ srcs = glob(["src/**/*.java"]),
+ deps = [
+ "//lib:junit",
+ "//org.eclipse.jgit:jgit",
+ "//org.eclipse.jgit.junit:junit",
+ "//org.eclipse.jgit.lfs:jgit-lfs",
+ ],
+)
diff --git a/org.eclipse.jgit.lfs.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.lfs.test/META-INF/MANIFEST.MF
index e859f6337a..3a01c6e532 100644
--- a/org.eclipse.jgit.lfs.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.lfs.test/META-INF/MANIFEST.MF
@@ -2,19 +2,23 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin_name
Bundle-SymbolicName: org.eclipse.jgit.lfs.test
-Bundle-Version: 4.6.2.qualifier
+Bundle-Version: 4.7.8.qualifier
Bundle-Vendor: %provider_name
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Import-Package: org.eclipse.jgit.junit;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lfs;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lfs.errors;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lfs.lib;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lib;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.util;version="[4.6.2,4.7.0)",
+Import-Package: org.eclipse.jgit.internal.storage.dfs;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.junit;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lfs;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lfs.errors;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lfs.lib;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lib;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.revwalk;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.treewalk;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.treewalk.filter;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.util;version="[4.7.8,4.8.0)",
org.hamcrest.core;version="[1.1.0,2.0.0)",
org.junit;version="[4.0.0,5.0.0)",
org.junit.runner;version="[4.0.0,5.0.0)",
org.junit.runners;version="[4.0.0,5.0.0)"
-Export-Package: org.eclipse.jgit.lfs.test;version="4.6.2";x-friends:="org.eclipse.jgit.lfs.server.test"
+Export-Package: org.eclipse.jgit.lfs.test;version="4.7.8";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 a06aefc1f8..814e3eed24 100644
--- a/org.eclipse.jgit.lfs.test/pom.xml
+++ b/org.eclipse.jgit.lfs.test/pom.xml
@@ -50,7 +50,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit-parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.jgit.lfs.test</artifactId>
diff --git a/org.eclipse.jgit.lfs.test/tst/org/eclipse/jgit/lfs/lib/LfsPointerFilterTest.java b/org.eclipse.jgit.lfs.test/tst/org/eclipse/jgit/lfs/lib/LfsPointerFilterTest.java
new file mode 100644
index 0000000000..a56f0df89b
--- /dev/null
+++ b/org.eclipse.jgit.lfs.test/tst/org/eclipse/jgit/lfs/lib/LfsPointerFilterTest.java
@@ -0,0 +1,214 @@
+/*
+ * Copyright (C) 2015, Dariusz Luksza <dariusz@luksza.org>
+ * 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 v1.0 which
+ * accompanies this distribution, is reproduced below, and is
+ * available at http://www.eclipse.org/org/documents/edl-v10.php
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * - Neither the name of the Eclipse Foundation, Inc. nor the
+ * names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.eclipse.jgit.lfs.lib;
+
+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;
+
+import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription;
+import org.eclipse.jgit.internal.storage.dfs.InMemoryRepository;
+import org.eclipse.jgit.junit.TestRepository;
+import org.eclipse.jgit.revwalk.ObjectWalk;
+import org.eclipse.jgit.revwalk.RevCommit;
+import org.eclipse.jgit.revwalk.RevTree;
+import org.eclipse.jgit.treewalk.TreeWalk;
+import org.junit.Test;
+
+public class LfsPointerFilterTest {
+
+ private static final int SIZE = 12345;
+
+ private static final String OID = "4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393";
+
+ private static final String[] NOT_VALID_LFS_FILES = { "", // empty file
+ // simulate java file
+ "package org.eclipse.jgit;",
+ // invalid LFS pointer, no oid and version
+ "version https://hawser.github.com/spec/v1\n",
+ // invalid LFS pointer, no version
+ "version https://hawser.github.com/spec/v1\n"
+ + "oid sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393\n",
+ // invalid LFS pointer, no id
+ "version https://hawser.github.com/spec/v1\n" + "size 12345\n",
+ // invalid LFS pointer, wrong order of oid and size
+ "version https://hawser.github.com/spec/v1\n" + "size 12345\n"
+ + "oid sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393\n" };
+
+ private static final String[] LFS_VERSION_DOMAINS = {
+ "hawser", "git-lfs"
+ };
+
+ private static final String[] VALID_LFS_FILES = {
+ // valid LFS pointer
+ "version https://%s.github.com/spec/v1\n"
+ + "oid sha256:" + OID + "\n"
+ + "size " + SIZE + "\n",
+ // valid LFS pointer with "custom" key
+ "version https://%s.github.com/spec/v1\n"
+ + "custom key with value\n"
+ + "oid sha256:" + OID + "\n"
+ + "size " + SIZE + "\n",
+ // valid LFS pointer with key with "."
+ "version https://%s.github.com/spec/v1\n"
+ + "oid sha256:" + OID + "\n"
+ + "r.key key with .\n"
+ + "size " + SIZE + "\n",
+ // valid LFS pointer with key with "-"
+ "version https://%s.github.com/spec/v1\n"
+ + "oid sha256:" + OID + "\n"
+ + "size " + SIZE + "\n"
+ + "valid-name another valid key\n" };
+
+ @Test
+ public void testRegularFilesInRepositoryRoot() throws Exception {
+ for (String file : NOT_VALID_LFS_FILES) {
+ assertLfs("file.bin", file).withRecursive(false).shouldBe(false);
+ }
+ }
+
+ @Test
+ public void testNestedRegularFiles() throws Exception {
+ for (String file : NOT_VALID_LFS_FILES) {
+ assertLfs("a/file.bin", file).withRecursive(true).shouldBe(false);
+ }
+ }
+
+ @Test
+ public void testValidPointersInRepositoryRoot() throws Exception {
+ for (String domain : LFS_VERSION_DOMAINS) {
+ for (String file : VALID_LFS_FILES) {
+ assertLfs("file.bin", String.format(file, domain))
+ .withRecursive(true).shouldBe(true)
+ .check();
+ }
+ }
+ }
+
+ @Test
+ public void testValidNestedPointers() throws Exception {
+ for (String domain : LFS_VERSION_DOMAINS) {
+ for (String file : VALID_LFS_FILES) {
+ assertLfs("a/file.bin", String.format(file, domain))
+ .withRecursive(true).shouldBe(true).check();
+ }
+ }
+ }
+
+ @Test
+ public void testValidNestedPointersWithoutRecurrence() throws Exception {
+ for (String domain : LFS_VERSION_DOMAINS) {
+ for (String file : VALID_LFS_FILES) {
+ assertLfs("file.bin", String.format(file, domain))
+ .withRecursive(false).shouldBe(true).check();
+ assertLfs("a/file.bin", String.format(file, domain))
+ .withRecursive(false).shouldBe(false).check();
+ }
+ }
+ }
+
+ private static LfsTreeWalk assertLfs(String path, String content) {
+ return new LfsTreeWalk(path, content);
+ }
+
+ private static class LfsTreeWalk {
+ private final String path;
+
+ private final String content;
+
+ private boolean state;
+
+ private boolean recursive;
+
+ private TestRepository<InMemoryRepository> tr;
+
+ LfsTreeWalk(String path, String content) {
+ this.path = path;
+ this.content = content;
+ }
+
+ LfsTreeWalk withRecursive(boolean shouldBeRecursive) {
+ this.recursive = shouldBeRecursive;
+ return this;
+ }
+
+ LfsTreeWalk shouldBe(boolean shouldBeValid) {
+ this.state = shouldBeValid;
+ return this;
+ }
+
+ void check() throws Exception {
+ tr = new TestRepository<>(new InMemoryRepository(
+ new DfsRepositoryDescription("test")));
+ RevCommit commit = tr.branch("master").commit().add(path, content)
+ .message("initial commit").create();
+ RevTree tree = parseCommit(commit);
+ LfsPointerFilter filter = new LfsPointerFilter();
+ try (TreeWalk treeWalk = new TreeWalk(tr.getRepository())) {
+ treeWalk.addTree(tree);
+ treeWalk.setRecursive(recursive);
+ treeWalk.setFilter(filter);
+
+ if (state) {
+ assertTrue(treeWalk.next());
+ assertEquals(path, treeWalk.getPathString());
+ assertNotNull(filter.getPointer());
+ assertEquals(SIZE, filter.getPointer().getSize());
+ assertEquals(OID, filter.getPointer().getOid().name());
+ } else {
+ assertFalse(treeWalk.next());
+ assertNull(filter.getPointer());
+ }
+ }
+ }
+
+ private RevTree parseCommit(RevCommit commit) throws Exception {
+ try (ObjectWalk ow = new ObjectWalk(tr.getRepository())) {
+ return ow.parseCommit(commit).getTree();
+ }
+ }
+ }
+}
diff --git a/org.eclipse.jgit.lfs.test/tst/org/eclipse/jgit/lfs/lib/LongObjectIdTest.java b/org.eclipse.jgit.lfs.test/tst/org/eclipse/jgit/lfs/lib/LongObjectIdTest.java
index 435a2a3c39..e754d6f744 100644
--- a/org.eclipse.jgit.lfs.test/tst/org/eclipse/jgit/lfs/lib/LongObjectIdTest.java
+++ b/org.eclipse.jgit.lfs.test/tst/org/eclipse/jgit/lfs/lib/LongObjectIdTest.java
@@ -57,6 +57,7 @@ import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
+import java.util.Locale;
import org.eclipse.jgit.junit.JGitTestUtil;
import org.eclipse.jgit.lfs.errors.InvalidLongObjectIdException;
@@ -152,7 +153,7 @@ public class LongObjectIdTest {
public void test011_toString() {
final String x = "0123456789ABCDEFabcdef01234567890123456789ABCDEFabcdef0123456789";
final LongObjectId oid = LongObjectId.fromString(x);
- assertEquals(x.toLowerCase(), oid.name());
+ assertEquals(x.toLowerCase(Locale.ROOT), oid.name());
}
@Test
@@ -290,7 +291,6 @@ public class LongObjectIdTest {
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef");
assertEquals(0, id1.compareTo(LongObjectId.fromString(
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef")));
- assertEquals(0, id1.compareTo(id1));
assertEquals(-1, id1.compareTo(LongObjectId.fromString(
"1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef")));
diff --git a/org.eclipse.jgit.lfs/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.lfs/.settings/org.eclipse.jdt.core.prefs
index 808ec3a2c6..ede0f7d55d 100644
--- a/org.eclipse.jgit.lfs/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.lfs/.settings/org.eclipse.jdt.core.prefs
@@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -76,7 +76,7 @@ org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
diff --git a/org.eclipse.jgit.lfs/BUCK b/org.eclipse.jgit.lfs/BUCK
deleted file mode 100644
index ddb3a10803..0000000000
--- a/org.eclipse.jgit.lfs/BUCK
+++ /dev/null
@@ -1,17 +0,0 @@
-SRCS = glob(['src/**'])
-RESOURCES = glob(['resources/**'])
-
-java_library(
- name = 'jgit-lfs',
- srcs = SRCS,
- resources = RESOURCES,
- deps = [
- '//org.eclipse.jgit:jgit'
- ],
- visibility = ['PUBLIC'],
-)
-
-java_sources(
- name = 'jgit-lfs_src',
- srcs = SRCS + RESOURCES,
-)
diff --git a/org.eclipse.jgit.lfs/BUILD b/org.eclipse.jgit.lfs/BUILD
new file mode 100644
index 0000000000..c4c9f8aad3
--- /dev/null
+++ b/org.eclipse.jgit.lfs/BUILD
@@ -0,0 +1,11 @@
+package(default_visibility = ["//visibility:public"])
+
+java_library(
+ name = "jgit-lfs",
+ srcs = glob(["src/**"]),
+ resource_strip_prefix = "org.eclipse.jgit.lfs/resources",
+ resources = glob(["resources/**"]),
+ deps = [
+ "//org.eclipse.jgit:jgit",
+ ],
+)
diff --git a/org.eclipse.jgit.lfs/META-INF/MANIFEST.MF b/org.eclipse.jgit.lfs/META-INF/MANIFEST.MF
index d5d1f7cbdd..0c03da3768 100644
--- a/org.eclipse.jgit.lfs/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.lfs/META-INF/MANIFEST.MF
@@ -2,17 +2,20 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin_name
Bundle-SymbolicName: org.eclipse.jgit.lfs
-Bundle-Version: 4.6.2.qualifier
+Bundle-Version: 4.7.8.qualifier
Bundle-Localization: plugin
Bundle-Vendor: %provider_name
-Export-Package: org.eclipse.jgit.lfs;version="4.6.2",
- org.eclipse.jgit.lfs.errors;version="4.6.2",
- org.eclipse.jgit.lfs.internal;version="4.6.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="4.6.2"
+Export-Package: org.eclipse.jgit.lfs;version="4.7.8",
+ org.eclipse.jgit.lfs.errors;version="4.7.8",
+ org.eclipse.jgit.lfs.internal;version="4.7.8";x-friends:="org.eclipse.jgit.lfs.test,org.eclipse.jgit.lfs.server.fs,org.eclipse.jgit.lfs.server",
+ org.eclipse.jgit.lfs.lib;version="4.7.8"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Import-Package: org.eclipse.jgit.annotations;version="[4.6.2,4.7.0)";resolution:=optional,
- org.eclipse.jgit.attributes;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.internal.storage.file;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lib;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.nls;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.util;version="[4.6.2,4.7.0)"
+Import-Package: org.eclipse.jgit.annotations;version="[4.7.8,4.8.0)";resolution:=optional,
+ org.eclipse.jgit.attributes;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.errors;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.internal.storage.file;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lib;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.nls;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.treewalk;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.treewalk.filter;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.util;version="[4.7.8,4.8.0)"
diff --git a/org.eclipse.jgit.lfs/pom.xml b/org.eclipse.jgit.lfs/pom.xml
index 049b3601a7..3b165fa69a 100644
--- a/org.eclipse.jgit.lfs/pom.xml
+++ b/org.eclipse.jgit.lfs/pom.xml
@@ -50,7 +50,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit-parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.jgit.lfs</artifactId>
diff --git a/org.eclipse.jgit.lfs/resources/org/eclipse/jgit/lfs/internal/LfsText.properties b/org.eclipse.jgit.lfs/resources/org/eclipse/jgit/lfs/internal/LfsText.properties
index 5e52a782f0..e08e28cc55 100644
--- a/org.eclipse.jgit.lfs/resources/org/eclipse/jgit/lfs/internal/LfsText.properties
+++ b/org.eclipse.jgit.lfs/resources/org/eclipse/jgit/lfs/internal/LfsText.properties
@@ -7,3 +7,5 @@ requiredHashFunctionNotAvailable=Required hash function {0} not available.
repositoryNotFound=Repository {0} not found
repositoryReadOnly=Repository {0} is read-only
lfsUnavailable=LFS is not available for repository {0}
+lfsUnathorized=Not authorized to perform operation {0} on repository {1}
+lfsFailedToGetRepository=failed to get repository {0}
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java
index 66feca7518..b78ee047e5 100644
--- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java
+++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java
@@ -130,6 +130,7 @@ public class CleanFilter extends FilterCommand {
this.aOut = new AtomicObjectOutputStream(tmpFile.toAbsolutePath());
}
+ @Override
public int run() throws IOException {
try {
byte[] buf = new byte[8192];
@@ -151,7 +152,10 @@ public class CleanFilter extends FilterCommand {
FileUtils.delete(tmpFile.toFile());
}
} else {
- FileUtils.mkdirs(mediaFile.getParent().toFile(), true);
+ Path parent = mediaFile.getParent();
+ if (parent != null) {
+ FileUtils.mkdirs(parent.toFile(), true);
+ }
FileUtils.rename(tmpFile.toFile(), mediaFile.toFile(),
StandardCopyOption.ATOMIC_MOVE);
}
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPointer.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPointer.java
index bbea53567f..0f62025be5 100644
--- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPointer.java
+++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPointer.java
@@ -51,6 +51,7 @@ import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.nio.charset.UnsupportedCharsetException;
+import java.util.Locale;
import org.eclipse.jgit.annotations.Nullable;
import org.eclipse.jgit.lfs.lib.AnyLongObjectId;
@@ -69,11 +70,17 @@ public class LfsPointer {
public static final String VERSION = "https://git-lfs.github.com/spec/v1"; //$NON-NLS-1$
/**
+ * The version of the LfsPointer file format using legacy URL
+ * @since 4.7
+ */
+ public static final String VERSION_LEGACY = "https://hawser.github.com/spec/v1"; //$NON-NLS-1$
+
+ /**
* The name of the hash function as used in the pointer files. This will
* evaluate to "sha256"
*/
public static final String HASH_FUNCTION_NAME = Constants.LONG_HASH_FUNCTION
- .toLowerCase().replace("-", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ .toLowerCase(Locale.ROOT).replace("-", ""); //$NON-NLS-1$ //$NON-NLS-2$
private AnyLongObjectId oid;
@@ -150,14 +157,13 @@ public class LfsPointer {
if (s.startsWith("#") || s.length() == 0) { //$NON-NLS-1$
continue;
} else if (s.startsWith("version") && s.length() > 8 //$NON-NLS-1$
- && s.substring(8).trim().equals(VERSION)) {
+ && (s.substring(8).trim().equals(VERSION) ||
+ s.substring(8).trim().equals(VERSION_LEGACY))) {
versionLine = true;
} else if (s.startsWith("oid sha256:")) { //$NON-NLS-1$
id = LongObjectId.fromString(s.substring(11).trim());
} else if (s.startsWith("size") && s.length() > 5) { //$NON-NLS-1$
sz = Long.parseLong(s.substring(5).trim());
- } else {
- return null;
}
}
if (versionLine && id != null && sz > -1) {
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/errors/LfsUnauthorized.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/errors/LfsUnauthorized.java
new file mode 100644
index 0000000000..62b0cde4c9
--- /dev/null
+++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/errors/LfsUnauthorized.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2017, David Pursehouse <david.pursehouse@gmail.com>
+ * 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 v1.0 which
+ * accompanies this distribution, is reproduced below, and is
+ * available at http://www.eclipse.org/org/documents/edl-v10.php
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * - Neither the name of the Eclipse Foundation, Inc. nor the
+ * names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.eclipse.jgit.lfs.errors;
+
+import java.text.MessageFormat;
+
+import org.eclipse.jgit.lfs.internal.LfsText;
+
+/**
+ * Thrown when authorization was refused for an LFS operation.
+ *
+ * @since 4.7
+ */
+public class LfsUnauthorized extends LfsException {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * @param operation
+ * the operation that was attempted.
+ * @param name
+ * the repository name.
+ */
+ public LfsUnauthorized(String operation, String name) {
+ super(MessageFormat.format(LfsText.get().lfsUnathorized, operation,
+ name));
+ }
+}
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java
index c76df39354..44595887c4 100644
--- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java
+++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java
@@ -67,4 +67,6 @@ public class LfsText extends TranslationBundle {
/***/ public String repositoryNotFound;
/***/ public String repositoryReadOnly;
/***/ public String lfsUnavailable;
+ /***/ public String lfsUnathorized;
+ /***/ public String lfsFailedToGetRepository;
}
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AnyLongObjectId.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AnyLongObjectId.java
index 1f0df882d2..caf034d933 100644
--- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AnyLongObjectId.java
+++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AnyLongObjectId.java
@@ -171,6 +171,7 @@ public abstract class AnyLongObjectId implements Comparable<AnyLongObjectId> {
* @return &lt; 0 if this id comes before other; 0 if this id is equal to
* other; &gt; 0 if this id comes after other.
*/
+ @Override
public final int compareTo(final AnyLongObjectId other) {
if (this == other)
return 0;
@@ -262,6 +263,7 @@ public abstract class AnyLongObjectId implements Comparable<AnyLongObjectId> {
return abbr.prefixCompare(this) == 0;
}
+ @Override
public final int hashCode() {
return (int) (w1 >> 32);
}
@@ -277,6 +279,7 @@ public abstract class AnyLongObjectId implements Comparable<AnyLongObjectId> {
return other != null ? equals(this, other) : false;
}
+ @Override
public final boolean equals(final Object o) {
if (o instanceof AnyLongObjectId)
return equals((AnyLongObjectId) o);
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/Constants.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/Constants.java
index a88057afce..0220743724 100644
--- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/Constants.java
+++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/Constants.java
@@ -87,6 +87,27 @@ public final class Constants {
* 2;
/**
+ * LFS upload operation.
+ *
+ * @since 4.7
+ */
+ public static final String UPLOAD = "upload";
+
+ /**
+ * LFS download operation.
+ *
+ * @since 4.7
+ */
+ public static final String DOWNLOAD = "download";
+
+ /**
+ * LFS verify operation.
+ *
+ * @since 4.7
+ */
+ public static final String VERIFY = "verify";
+
+ /**
* Create a new digest function for objects.
*
* @return a new digest object.
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FileUtils7Test.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/LfsPointerFilter.java
index cc1fdc21b9..6f672b88f0 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FileUtils7Test.java
+++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/LfsPointerFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013, Robin Rosenberg <robin.rosenberg@dewire.com>
+ * Copyright (C) 2015, 2017, Dariusz Luksza <dariusz@luksza.org>
* and other copyright owners as documented in the project's IP log.
*
* This program and the accompanying materials are made available
@@ -41,59 +41,63 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-package org.eclipse.jgit.util;
+package org.eclipse.jgit.lfs.lib;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.StandardCopyOption;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.eclipse.jgit.errors.IncorrectObjectTypeException;
+import org.eclipse.jgit.errors.MissingObjectException;
+import org.eclipse.jgit.lfs.LfsPointer;
+import org.eclipse.jgit.lib.ObjectId;
+import org.eclipse.jgit.lib.ObjectLoader;
+import org.eclipse.jgit.lib.ObjectStream;
+import org.eclipse.jgit.treewalk.TreeWalk;
+import org.eclipse.jgit.treewalk.filter.TreeFilter;
-public class FileUtils7Test {
+/**
+ * Detects Large File pointers, as described in [1] in Git repository.
+ *
+ * [1] https://github.com/github/git-lfs/blob/master/docs/spec.md
+ *
+ * @since 4.7
+ */
+public class LfsPointerFilter extends TreeFilter {
- private final File trash = new File(new File("target"), "trash");
+ private LfsPointer pointer;
- @Before
- public void setUp() throws Exception {
- FileUtils.delete(trash, FileUtils.RECURSIVE | FileUtils.RETRY | FileUtils.SKIP_MISSING);
- assertTrue(trash.mkdirs());
+ /**
+ * @return {@link LfsPointer} or {@code null}
+ */
+ public LfsPointer getPointer() {
+ return pointer;
}
- @After
- public void tearDown() throws Exception {
- FileUtils.delete(trash, FileUtils.RECURSIVE | FileUtils.RETRY);
+ @Override
+ public boolean include(TreeWalk walk) throws MissingObjectException,
+ IncorrectObjectTypeException, IOException {
+ pointer = null;
+ if (walk.isSubtree()) {
+ return walk.isRecursive();
+ }
+ ObjectId objectId = walk.getObjectId(0);
+ ObjectLoader object = walk.getObjectReader().open(objectId);
+ if (object.getSize() > 1024) {
+ return false;
+ }
+
+ try (ObjectStream stream = object.openStream()) {
+ pointer = LfsPointer.parseLfsPointer(stream);
+ return pointer != null;
+ }
}
- @Test
- public void testDeleteSymlinkToDirectoryDoesNotDeleteTarget()
- throws IOException {
- org.junit.Assume.assumeTrue(FS.DETECTED.supportsSymlinks());
- FS fs = FS.DETECTED;
- File dir = new File(trash, "dir");
- File file = new File(dir, "file");
- File link = new File(trash, "link");
- FileUtils.mkdirs(dir);
- FileUtils.createNewFile(file);
- fs.createSymLink(link, "dir");
- FileUtils.delete(link, FileUtils.RECURSIVE);
- assertFalse(link.exists());
- assertTrue(dir.exists());
- assertTrue(file.exists());
+ @Override
+ public boolean shouldBeRecursive() {
+ return false;
}
- @Test
- public void testAtomicMove() throws IOException {
- File src = new File(trash, "src");
- Files.createFile(src.toPath());
- File dst = new File(trash, "dst");
- FileUtils.rename(src, dst, StandardCopyOption.ATOMIC_MOVE);
- assertFalse(Files.exists(src.toPath()));
- assertTrue(Files.exists(dst.toPath()));
+ @Override
+ public TreeFilter clone() {
+ return new LfsPointerFilter();
}
}
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 85ac88b4b3..0e460d05c5 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="4.6.2.qualifier"
+ version="4.7.8.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 6f75186def..ca0fdb0469 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml
@@ -50,7 +50,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>jgit.tycho.parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-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 e272c0b95f..3df9982cae 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="4.6.2.qualifier"
+ version="4.7.8.qualifier"
provider-name="%providerName">
<description url="http://www.eclipse.org/jgit/">
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 679f880d9a..01651232d6 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
@@ -50,7 +50,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>jgit.tycho.parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-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 fe7e3acb43..fd1168eb18 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="4.6.2.qualifier"
+ version="4.7.8.qualifier"
provider-name="%providerName">
<description url="http://www.eclipse.org/jgit/">
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 0b0a335af4..d071ebd9da 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
@@ -50,7 +50,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>jgit.tycho.parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-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 4aefd72ed2..a106abf147 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="4.6.2.qualifier"
+ version="4.7.8.qualifier"
provider-name="%providerName">
<description url="http://www.eclipse.org/jgit/">
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 893c49215a..7592a06e6a 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
@@ -50,7 +50,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>jgit.tycho.parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-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 2c91754a30..d592b00542 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="4.6.2.qualifier"
+ version="4.7.8.qualifier"
provider-name="%providerName">
<description url="http://www.eclipse.org/jgit/">
@@ -31,8 +31,8 @@
version="0.0.0"/>
<requires>
- <import feature="org.eclipse.jgit" version="4.6.2" match="equivalent"/>
- <import feature="org.eclipse.jgit.lfs" version="4.6.2" match="equivalent"/>
+ <import feature="org.eclipse.jgit" version="4.7.8" match="equivalent"/>
+ <import feature="org.eclipse.jgit.lfs" version="4.7.8" 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 b6c5846de0..2009d11feb 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
@@ -50,7 +50,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>jgit.tycho.parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.jgit.feature</groupId>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.xml
index 444a8728a3..f5a4d32ef7 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.xml
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.jgit.pgm.source"
label="%featureName"
- version="4.6.2.qualifier"
+ version="4.7.8.qualifier"
provider-name="%providerName">
<description url="http://www.eclipse.org/jgit/">
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/pom.xml
index a35034af22..d205eae08c 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/pom.xml
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/pom.xml
@@ -50,7 +50,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>jgit.tycho.parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.jgit.feature</groupId>
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 d611d2948f..42a9d7227a 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml
@@ -50,7 +50,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>jgit.tycho.parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-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 20ab58caab..fca28bed55 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="4.6.2.qualifier"
+ version="4.7.8.qualifier"
provider-name="%providerName">
<description url="http://www.eclipse.org/jgit/">
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 e11e042099..1d989c76b3 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
@@ -50,7 +50,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>jgit.tycho.parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.jgit.feature</groupId>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/META-INF/MANIFEST.MF b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/META-INF/MANIFEST.MF
index cd392319e0..9eaa829366 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/META-INF/MANIFEST.MF
@@ -2,4 +2,4 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: JGit Target Platform Bundle
Bundle-SymbolicName: org.eclipse.jgit.target
-Bundle-Version: 4.6.2.qualifier
+Bundle-Version: 4.7.8.qualifier
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.5.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.5.target
index d0da0c4153..be02826e8e 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.5.target
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.5.target
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
-<target name="jgit-4.5" sequenceNumber="1502746491">
+<target name="jgit-4.5" sequenceNumber="1502747250">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.3.17.v20170317"/>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target
index 065284de19..bcef50bd36 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
-<target name="jgit-4.6" sequenceNumber="1502746433">
+<target name="jgit-4.6" sequenceNumber="1502747233">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.3.17.v20170317"/>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.target
index d3a11314fb..52ea6f81aa 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.target
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.target
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
-<target name="jgit-4.7" sequenceNumber="1502746477">
+<target name="jgit-4.7" sequenceNumber="1502747215">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.3.17.v20170317"/>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml
index 652b122eb4..3436f1995e 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml
@@ -49,7 +49,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>jgit.tycho.parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.jgit.target</artifactId>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/projects/jetty-9.3.9.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/projects/jetty-9.3.9.tpd
new file mode 100644
index 0000000000..d5621a07e3
--- /dev/null
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/projects/jetty-9.3.9.tpd
@@ -0,0 +1,20 @@
+target "jetty-9.4.3" with source configurePhase
+
+location jetty-9.4.3 "http://download.eclipse.org/jetty/updates/jetty-bundles-9.x/9.3.9.v20160517/" {
+ org.eclipse.jetty.client [9.3.9.v20160517,9.3.9.v20160517]
+ org.eclipse.jetty.client.source [9.3.9.v20160517,9.3.9.v20160517]
+ org.eclipse.jetty.continuation [9.3.9.v20160517,9.3.9.v20160517]
+ org.eclipse.jetty.continuation.source [9.3.9.v20160517,9.3.9.v20160517]
+ org.eclipse.jetty.http [9.3.9.v20160517,9.3.9.v20160517]
+ org.eclipse.jetty.http.source [9.3.9.v20160517,9.3.9.v20160517]
+ org.eclipse.jetty.io [9.3.9.v20160517,9.3.9.v20160517]
+ org.eclipse.jetty.io.source [9.3.9.v20160517,9.3.9.v20160517]
+ org.eclipse.jetty.security [9.3.9.v20160517,9.3.9.v20160517]
+ org.eclipse.jetty.security.source [9.3.9.v20160517,9.3.9.v20160517]
+ org.eclipse.jetty.server [9.3.9.v20160517,9.3.9.v20160517]
+ org.eclipse.jetty.server.source [9.3.9.v20160517,9.3.9.v20160517]
+ org.eclipse.jetty.servlet [9.3.9.v20160517,9.3.9.v20160517]
+ org.eclipse.jetty.servlet.source [9.3.9.v20160517,9.3.9.v20160517]
+ org.eclipse.jetty.util [9.3.9.v20160517,9.3.9.v20160517]
+ org.eclipse.jetty.util.source [9.3.9.v20160517,9.3.9.v20160517]
+}
diff --git a/org.eclipse.jgit.packaging/pom.xml b/org.eclipse.jgit.packaging/pom.xml
index 583b12831a..fc38e76a90 100644
--- a/org.eclipse.jgit.packaging/pom.xml
+++ b/org.eclipse.jgit.packaging/pom.xml
@@ -53,7 +53,7 @@
<groupId>org.eclipse.jgit</groupId>
<artifactId>jgit.tycho.parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JGit Tycho Parent</name>
diff --git a/org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs
index 10c29d5576..64f74989e1 100644
--- a/org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs
@@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -76,7 +76,7 @@ org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
diff --git a/org.eclipse.jgit.pgm.test/BUCK b/org.eclipse.jgit.pgm.test/BUCK
deleted file mode 100644
index cd15510798..0000000000
--- a/org.eclipse.jgit.pgm.test/BUCK
+++ /dev/null
@@ -1,37 +0,0 @@
-TESTS = glob(['tst/**/*.java'])
-
-for t in TESTS:
- n = t[len('tst/'):len(t)-len('.java')].replace('/', '.')
- java_test(
- name = n,
- labels = ['pgm'],
- srcs = [t],
- deps = [
- ':helpers',
- '//org.eclipse.jgit:jgit',
- '//org.eclipse.jgit.archive:jgit-archive',
- '//org.eclipse.jgit.junit:junit',
- '//org.eclipse.jgit.pgm:pgm',
- '//lib:hamcrest-core',
- '//lib:hamcrest-library',
- '//lib:javaewah',
- '//lib:junit',
- '//lib:slf4j-api',
- '//lib:slf4j-simple',
- '//lib:commons-compress',
- '//lib:tukaani-xz',
- ],
- vm_args = ['-Xmx256m', '-Dfile.encoding=UTF-8'],
- )
-
-java_library(
- name = 'helpers',
- srcs = glob(['src/**/*.java']),
- deps = [
- '//org.eclipse.jgit:jgit',
- '//org.eclipse.jgit.pgm:pgm',
- '//org.eclipse.jgit.junit:junit',
- '//lib:args4j',
- '//lib:junit',
- ],
-)
diff --git a/org.eclipse.jgit.pgm.test/BUILD b/org.eclipse.jgit.pgm.test/BUILD
new file mode 100644
index 0000000000..5d4a175f7a
--- /dev/null
+++ b/org.eclipse.jgit.pgm.test/BUILD
@@ -0,0 +1,40 @@
+load(
+ "@com_googlesource_gerrit_bazlets//tools:junit.bzl",
+ "junit_tests",
+)
+
+junit_tests(
+ name = "pgm",
+ srcs = glob(["tst/**/*.java"]),
+ jvm_flags = [
+ "-Xmx256m",
+ "-Dfile.encoding=UTF-8",
+ ],
+ tags = ["pgm"],
+ deps = [
+ ":helpers",
+ "//lib:commons-compress",
+ "//lib:javaewah",
+ "//lib:junit",
+ "//lib:slf4j-api",
+ "//lib:slf4j-simple",
+ "//lib:xz",
+ "//org.eclipse.jgit.archive:jgit-archive",
+ "//org.eclipse.jgit:jgit",
+ "//org.eclipse.jgit.junit:junit",
+ "//org.eclipse.jgit.pgm:pgm",
+ ],
+)
+
+java_library(
+ name = "helpers",
+ testonly = 1,
+ srcs = glob(["src/**/*.java"]),
+ deps = [
+ "//lib:args4j",
+ "//lib:junit",
+ "//org.eclipse.jgit:jgit",
+ "//org.eclipse.jgit.junit:junit",
+ "//org.eclipse.jgit.pgm:pgm",
+ ],
+)
diff --git a/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF
index 8e7d5abe2c..055a806c50 100644
--- a/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF
@@ -2,28 +2,28 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin_name
Bundle-SymbolicName: org.eclipse.jgit.pgm.test
-Bundle-Version: 4.6.2.qualifier
+Bundle-Version: 4.7.8.qualifier
Bundle-Vendor: %provider_name
Bundle-Localization: plugin
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Import-Package: org.eclipse.jgit.api;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.api.errors;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.diff;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.dircache;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.internal.storage.file;version="4.6.2",
- org.eclipse.jgit.junit;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lib;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.merge;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.pgm;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.pgm.internal;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.pgm.opt;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.revwalk;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.storage.file;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.transport;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.treewalk;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.util;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.util.io;version="[4.6.2,4.7.0)",
+Import-Package: org.eclipse.jgit.api;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.api.errors;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.diff;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.dircache;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.internal.storage.file;version="4.7.8",
+ org.eclipse.jgit.junit;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lib;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.merge;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.pgm;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.pgm.internal;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.pgm.opt;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.revwalk;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.storage.file;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.transport;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.treewalk;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.util;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.util.io;version="[4.7.8,4.8.0)",
org.hamcrest.core;bundle-version="[1.1.0,2.0.0)",
org.junit;version="[4.11.0,5.0.0)",
org.junit.rules;version="[4.11.0,5.0.0)",
diff --git a/org.eclipse.jgit.pgm.test/pom.xml b/org.eclipse.jgit.pgm.test/pom.xml
index c8188cb717..2c98530535 100644
--- a/org.eclipse.jgit.pgm.test/pom.xml
+++ b/org.eclipse.jgit.pgm.test/pom.xml
@@ -50,7 +50,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit-parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.jgit.pgm.test</artifactId>
diff --git a/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/lib/CLIRepositoryTestCase.java b/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/lib/CLIRepositoryTestCase.java
index b675d3c31d..0eeababc5d 100644
--- a/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/lib/CLIRepositoryTestCase.java
+++ b/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/lib/CLIRepositoryTestCase.java
@@ -79,7 +79,7 @@ public class CLIRepositoryTestCase extends LocalDiskRepositoryTestCase {
* @throws Exception
*/
protected String[] executeUnchecked(String... cmds) throws Exception {
- List<String> result = new ArrayList<String>(cmds.length);
+ List<String> result = new ArrayList<>(cmds.length);
for (String cmd : cmds) {
result.addAll(CLIGitCommand.executeUnchecked(cmd, db));
}
@@ -97,7 +97,7 @@ public class CLIRepositoryTestCase extends LocalDiskRepositoryTestCase {
* @throws Exception
*/
protected String[] execute(String... cmds) throws Exception {
- List<String> result = new ArrayList<String>(cmds.length);
+ List<String> result = new ArrayList<>(cmds.length);
for (String cmd : cmds) {
Result r = CLIGitCommand.executeRaw(cmd, db);
if (r.ex instanceof TerminatedByHelpException) {
@@ -127,6 +127,7 @@ public class CLIRepositoryTestCase extends LocalDiskRepositoryTestCase {
return JGitTestUtil.writeTrashFile(db, name, data);
}
+ @Override
protected String read(final File file) throws IOException {
return JGitTestUtil.read(file);
}
diff --git a/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java b/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java
index b08bc8afe7..69eb1989d7 100644
--- a/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java
+++ b/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java
@@ -156,6 +156,7 @@ public class CLIGitCommand extends Main {
return new PrintWriter(result.err);
}
+ @Override
void init(final TextBuiltin cmd) throws IOException {
cmd.outs = result.out;
cmd.errs = result.err;
@@ -188,7 +189,7 @@ public class CLIGitCommand extends Main {
* @return the array
*/
static String[] split(String commandLine) {
- final List<String> list = new ArrayList<String>();
+ final List<String> list = new ArrayList<>();
boolean inquote = false;
boolean inDblQuote = false;
StringBuilder r = new StringBuilder();
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java
index 35467c6304..6f32bfaa52 100644
--- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java
+++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java
@@ -348,7 +348,7 @@ public class ArchiveTest extends CLIRepositoryTestCase {
commitBazAndFooSlashBar();
byte[] result = CLIGitCommand.executeRaw(
"git archive --prefix=x/ --format=zip master", db).outBytes();
- String[] expect = { "x/baz", "x/foo/", "x/foo/bar" };
+ String[] expect = { "x/", "x/baz", "x/foo/", "x/foo/bar" };
String[] actual = listZipEntries(result);
Arrays.sort(expect);
@@ -361,7 +361,7 @@ public class ArchiveTest extends CLIRepositoryTestCase {
commitBazAndFooSlashBar();
byte[] result = CLIGitCommand.executeRaw(
"git archive --prefix=x/ --format=tar master", db).outBytes();
- String[] expect = { "x/baz", "x/foo/", "x/foo/bar" };
+ String[] expect = { "x/", "x/baz", "x/foo/", "x/foo/bar" };
String[] actual = listTarEntries(result);
Arrays.sort(expect);
@@ -380,7 +380,7 @@ public class ArchiveTest extends CLIRepositoryTestCase {
commitFoo();
byte[] result = CLIGitCommand.executeRaw(
"git archive --prefix=x// --format=zip master", db).outBytes();
- String[] expect = { "x//foo" };
+ String[] expect = { "x/", "x//foo" };
assertArrayEquals(expect, listZipEntries(result));
}
@@ -389,7 +389,7 @@ public class ArchiveTest extends CLIRepositoryTestCase {
commitFoo();
byte[] result = CLIGitCommand.executeRaw(
"git archive --prefix=x// --format=tar master", db).outBytes();
- String[] expect = { "x//foo" };
+ String[] expect = { "x/", "x//foo" };
assertArrayEquals(expect, listTarEntries(result));
}
@@ -529,7 +529,7 @@ public class ArchiveTest extends CLIRepositoryTestCase {
@Test
public void testArchiveWithLongFilename() throws Exception {
StringBuilder filename = new StringBuilder();
- List<String> l = new ArrayList<String>();
+ List<String> l = new ArrayList<>();
for (int i = 0; i < 20; i++) {
filename.append("1234567890/");
l.add(filename.toString());
@@ -549,7 +549,7 @@ public class ArchiveTest extends CLIRepositoryTestCase {
@Test
public void testTarWithLongFilename() throws Exception {
StringBuilder filename = new StringBuilder();
- List<String> l = new ArrayList<String>();
+ List<String> l = new ArrayList<>();
for (int i = 0; i < 20; i++) {
filename.append("1234567890/");
l.add(filename.toString());
@@ -691,7 +691,7 @@ public class ArchiveTest extends CLIRepositoryTestCase {
}
private static String[] listZipEntries(byte[] zipData) throws IOException {
- List<String> l = new ArrayList<String>();
+ List<String> l = new ArrayList<>();
ZipInputStream in = new ZipInputStream(
new ByteArrayInputStream(zipData));
@@ -706,6 +706,7 @@ public class ArchiveTest extends CLIRepositoryTestCase {
ExecutorService executor = Executors.newSingleThreadExecutor();
return executor.submit(new Callable<Object>() {
+ @Override
public Object call() throws IOException {
try {
stream.write(data);
@@ -718,7 +719,7 @@ public class ArchiveTest extends CLIRepositoryTestCase {
}
private String[] listTarEntries(byte[] tarData) throws Exception {
- List<String> l = new ArrayList<String>();
+ List<String> l = new ArrayList<>();
Process proc = spawnAssumingCommandPresent("tar", "tf", "-");
BufferedReader reader = readFromProcess(proc);
OutputStream out = proc.getOutputStream();
@@ -749,7 +750,7 @@ public class ArchiveTest extends CLIRepositoryTestCase {
continue;
// found!
- List<String> l = new ArrayList<String>();
+ List<String> l = new ArrayList<>();
BufferedReader reader = new BufferedReader(
new InputStreamReader(in, "UTF-8"));
String line;
@@ -764,7 +765,7 @@ public class ArchiveTest extends CLIRepositoryTestCase {
private String[] tarEntryContent(byte[] tarData, String path)
throws Exception {
- List<String> l = new ArrayList<String>();
+ List<String> l = new ArrayList<>();
Process proc = spawnAssumingCommandPresent("tar", "Oxf", "-", path);
BufferedReader reader = readFromProcess(proc);
OutputStream out = proc.getOutputStream();
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 23aa97eeed..0ce645139d 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
@@ -73,7 +73,8 @@ public class ConfigTest extends CLIRepositoryTestCase {
.equals("Mac OS X");
String[] output = execute("git config --list");
- List<String> expect = new ArrayList<String>();
+ List<String> expect = new ArrayList<>();
+ expect.add("gc.autoDetach=false");
expect.add("core.filemode=" + !isWindows);
expect.add("core.logallrefupdates=true");
if (isMac)
diff --git a/org.eclipse.jgit.pgm/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.pgm/.settings/org.eclipse.jdt.core.prefs
index 4f1759fb3f..06ddbabb48 100644
--- a/org.eclipse.jgit.pgm/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.pgm/.settings/org.eclipse.jdt.core.prefs
@@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -76,7 +76,7 @@ org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
diff --git a/org.eclipse.jgit.pgm/BUCK b/org.eclipse.jgit.pgm/BUCK
deleted file mode 100644
index 5d5e6f7095..0000000000
--- a/org.eclipse.jgit.pgm/BUCK
+++ /dev/null
@@ -1,81 +0,0 @@
-include_defs('//tools/git.defs')
-
-java_library(
- name = 'pgm',
- srcs = glob(['src/**']),
- resources = glob(['resources/**']),
- deps = [
- ':services',
- '//org.eclipse.jgit:jgit',
- '//org.eclipse.jgit.archive:jgit-archive',
- '//org.eclipse.jgit.http.apache:http-apache',
- '//org.eclipse.jgit.lfs:jgit-lfs',
- '//org.eclipse.jgit.lfs.server:jgit-lfs-server',
- '//org.eclipse.jgit.ui:ui',
- '//lib:args4j',
- '//lib:httpcomponents',
- '//lib:httpcore',
- '//lib/jetty:http',
- '//lib/jetty:io',
- '//lib/jetty:server',
- '//lib/jetty:servlet',
- '//lib/jetty:security',
- '//lib/jetty:util',
- '//lib:servlet-api'
- ],
- visibility = ['PUBLIC'],
-)
-
-prebuilt_jar(
- name = 'services',
- binary_jar = ':services__jar',
-)
-
-genrule(
- name = 'services__jar',
- cmd = 'cd $SRCDIR ; zip -qr $OUT .',
- srcs = glob(['META-INF/services/*']),
- out = 'services.jar',
-)
-
-genrule(
- name = 'jgit',
- cmd = ''.join([
- 'mkdir $TMP/META-INF &&',
- 'cp $(location :binary_manifest) $TMP/META-INF/MANIFEST.MF &&',
- 'cp $(location :jgit_jar) $TMP/jgit.jar &&',
- 'cd $TMP && zip $TMP/jgit.jar META-INF/MANIFEST.MF &&',
- 'cat $SRCDIR/jgit.sh $TMP/jgit.jar >$OUT &&',
- 'chmod a+x $OUT',
- ]),
- srcs = ['jgit.sh'],
- out = 'jgit',
- visibility = ['PUBLIC'],
-)
-
-java_binary(
- name = 'jgit_jar',
- deps = [
- ':pgm',
- '//lib:slf4j-simple',
- '//lib:tukaani-xz',
- ],
- blacklist = [
- 'META-INF/DEPENDENCIES',
- 'META-INF/maven/.*',
- ],
-)
-
-genrule(
- name = 'binary_manifest',
- cmd = ';'.join(['echo "%s: %s" >>$OUT' % e for e in [
- ('Manifest-Version', '1.0'),
- ('Main-Class', 'org.eclipse.jgit.pgm.Main'),
- ('Bundle-Version', git_version()),
- ('Implementation-Title', 'JGit Command Line Interface'),
- ('Implementation-Vendor', 'Eclipse.org - JGit'),
- ('Implementation-Vendor-URL', 'http://www.eclipse.org/jgit/'),
- ('Implementation-Vendor-Id', 'org.eclipse.jgit'),
- ]] + ['echo >>$OUT']),
- out = 'MANIFEST.MF',
-)
diff --git a/org.eclipse.jgit.pgm/BUILD b/org.eclipse.jgit.pgm/BUILD
new file mode 100644
index 0000000000..6d3279031e
--- /dev/null
+++ b/org.eclipse.jgit.pgm/BUILD
@@ -0,0 +1,38 @@
+java_library(
+ name = "pgm",
+ srcs = glob(["src/**"]),
+ resource_strip_prefix = "org.eclipse.jgit.pgm/resources",
+ resources = glob(["resources/**"]),
+ visibility = ["//visibility:public"],
+ deps = [
+ ":services",
+ "//lib:args4j",
+ "//lib:httpclient",
+ "//lib:httpcore",
+ "//lib:jetty-http",
+ "//lib:jetty-io",
+ "//lib:jetty-security",
+ "//lib:jetty-server",
+ "//lib:jetty-servlet",
+ "//lib:jetty-util",
+ "//lib:servlet-api",
+ "//org.eclipse.jgit.archive:jgit-archive",
+ "//org.eclipse.jgit.http.apache:http-apache",
+ "//org.eclipse.jgit:jgit",
+ "//org.eclipse.jgit.lfs:jgit-lfs",
+ "//org.eclipse.jgit.lfs.server:jgit-lfs-server",
+ "//org.eclipse.jgit.ui:ui",
+ ],
+)
+
+java_import(
+ name = "services",
+ jars = [":services_jar"],
+)
+
+genrule(
+ name = "services_jar",
+ srcs = glob(["META-INF/services/*"]),
+ outs = ["services_jar.jar"],
+ cmd = "r=$$PWD && cd org.eclipse.jgit.pgm && zip -qr $$r/$@ .",
+)
diff --git a/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF b/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF
index 5c30da7547..aeaef456b2 100644
--- a/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin_name
Bundle-SymbolicName: org.eclipse.jgit.pgm
-Bundle-Version: 4.6.2.qualifier
+Bundle-Version: 4.7.8.qualifier
Bundle-Vendor: %provider_name
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
@@ -27,46 +27,46 @@ Import-Package: javax.servlet;version="[3.1.0,4.0.0)",
org.eclipse.jetty.util.log;version="[9.0.0,9.4.0)",
org.eclipse.jetty.util.security;version="[9.0.0,9.4.0)",
org.eclipse.jetty.util.thread;version="[9.0.0,9.4.0)",
- org.eclipse.jgit.api;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.api.errors;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.archive;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.awtui;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.blame;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.diff;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.dircache;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.errors;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.gitrepo;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.internal.ketch;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.internal.storage.file;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.internal.storage.pack;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.internal.storage.reftree;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lfs;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lfs.lib;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lfs.server;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lfs.server.fs;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lfs.server.s3;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lib;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.merge;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.nls;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.notes;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.revplot;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.revwalk;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.revwalk.filter;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.storage.file;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.storage.pack;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.transport;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.transport.http.apache;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.transport.resolver;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.treewalk;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.treewalk.filter;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.util;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.util.io;version="[4.6.2,4.7.0)",
+ org.eclipse.jgit.api;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.api.errors;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.archive;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.awtui;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.blame;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.diff;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.dircache;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.errors;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.gitrepo;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.internal.ketch;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.internal.storage.file;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.internal.storage.pack;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.internal.storage.reftree;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lfs;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lfs.lib;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lfs.server;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lfs.server.fs;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lfs.server.s3;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lib;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.merge;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.nls;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.notes;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.revplot;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.revwalk;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.revwalk.filter;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.storage.file;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.storage.pack;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.transport;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.transport.http.apache;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.transport.resolver;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.treewalk;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.treewalk.filter;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.util;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.util.io;version="[4.7.8,4.8.0)",
org.kohsuke.args4j;version="[2.0.12,2.1.0)",
org.kohsuke.args4j.spi;version="[2.0.15,2.1.0)"
-Export-Package: org.eclipse.jgit.console;version="4.6.2";
+Export-Package: org.eclipse.jgit.console;version="4.7.8";
uses:="org.eclipse.jgit.transport,
org.eclipse.jgit.util",
- org.eclipse.jgit.pgm;version="4.6.2";
+ org.eclipse.jgit.pgm;version="4.7.8";
uses:="org.eclipse.jgit.revwalk,
org.eclipse.jgit.treewalk.filter,
org.eclipse.jgit.pgm.opt,
@@ -77,11 +77,11 @@ Export-Package: org.eclipse.jgit.console;version="4.6.2";
org.eclipse.jgit.treewalk,
javax.swing,
org.eclipse.jgit.transport",
- org.eclipse.jgit.pgm.debug;version="4.6.2";
+ org.eclipse.jgit.pgm.debug;version="4.7.8";
uses:="org.eclipse.jgit.util.io,
org.eclipse.jgit.pgm",
- org.eclipse.jgit.pgm.internal;version="4.6.2";x-friends:="org.eclipse.jgit.pgm.test,org.eclipse.jgit.test",
- org.eclipse.jgit.pgm.opt;version="4.6.2";
+ org.eclipse.jgit.pgm.internal;version="4.7.8";x-friends:="org.eclipse.jgit.pgm.test,org.eclipse.jgit.test",
+ org.eclipse.jgit.pgm.opt;version="4.7.8";
uses:="org.eclipse.jgit.lib,
org.eclipse.jgit.revwalk,
org.kohsuke.args4j.spi,
diff --git a/org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF
index 443ccc8c3f..ff3f3ba588 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-ManifestVersion: 2
Bundle-Name: org.eclipse.jgit.pgm - Sources
Bundle-SymbolicName: org.eclipse.jgit.pgm.source
Bundle-Vendor: Eclipse.org - JGit
-Bundle-Version: 4.6.2.qualifier
-Eclipse-SourceBundle: org.eclipse.jgit.pgm;version="4.6.2.qualifier";roots="."
+Bundle-Version: 4.7.8.qualifier
+Eclipse-SourceBundle: org.eclipse.jgit.pgm;version="4.7.8.qualifier";roots="."
diff --git a/org.eclipse.jgit.pgm/pom.xml b/org.eclipse.jgit.pgm/pom.xml
index c6f4aca0df..0ddbf29f58 100644
--- a/org.eclipse.jgit.pgm/pom.xml
+++ b/org.eclipse.jgit.pgm/pom.xml
@@ -50,7 +50,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit-parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.jgit.pgm</artifactId>
diff --git a/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties b/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties
index 1d4bf76b9c..06e4d94f74 100644
--- a/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties
+++ b/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties
@@ -246,6 +246,8 @@ usage_LsTree=List the contents of a tree object
usage_MakeCacheTree=Show the current cache tree structure
usage_MergeBase=Find as good common ancestors as possible for a merge
usage_MergesTwoDevelopmentHistories=Merges two development histories
+usage_PreserveOldPacks=Preserve old pack files by moving them into the preserved subdirectory instead of deleting them after repacking
+usage_PrunePreserved=Remove the preserved subdirectory containing previously preserved old pack files before repacking, and before preserving more old pack files
usage_ReadDirCache= Read the DirCache 100 times
usage_RebuildCommitGraph=Recreate a repository from another one's commit graph
usage_RebuildRefTree=Copy references into a RefTree
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Add.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Add.java
index c36c485197..3c13590307 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Add.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Add.java
@@ -58,7 +58,7 @@ class Add extends TextBuiltin {
private boolean update = false;
@Argument(required = true, metaVar = "metaVar_filepattern", usage = "usage_filesToAddContentFrom")
- private List<String> filepatterns = new ArrayList<String>();
+ private List<String> filepatterns = new ArrayList<>();
@Override
protected void run() throws Exception {
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Blame.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Blame.java
index 0f541715ab..419325405f 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Blame.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Blame.java
@@ -114,7 +114,7 @@ class Blame extends TextBuiltin {
private String rangeString;
@Option(name = "--reverse", metaVar = "metaVar_blameReverse", usage = "usage_blameReverse")
- private List<RevCommit> reverseRange = new ArrayList<RevCommit>(2);
+ private List<RevCommit> reverseRange = new ArrayList<>(2);
@Argument(index = 0, required = false, metaVar = "metaVar_revision")
private String revision;
@@ -124,7 +124,7 @@ class Blame extends TextBuiltin {
private ObjectReader reader;
- private final Map<RevCommit, String> abbreviatedCommits = new HashMap<RevCommit, String>();
+ private final Map<RevCommit, String> abbreviatedCommits = new HashMap<>();
private SimpleDateFormat dateFmt;
@@ -163,7 +163,7 @@ class Blame extends TextBuiltin {
if (!reverseRange.isEmpty()) {
RevCommit rangeStart = null;
- List<RevCommit> rangeEnd = new ArrayList<RevCommit>(2);
+ List<RevCommit> rangeEnd = new ArrayList<>(2);
for (RevCommit c : reverseRange) {
if (c.has(RevFlag.UNINTERESTING))
rangeStart = c;
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java
index 5f3740cbba..f6e3810a86 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java
@@ -149,7 +149,7 @@ class Branch extends TextBuiltin {
@Argument(metaVar = "metaVar_name")
private String branch;
- private final Map<String, Ref> printRefs = new LinkedHashMap<String, Ref>();
+ private final Map<String, Ref> printRefs = new LinkedHashMap<>();
/** Only set for verbose branch listing at-the-moment */
private RevWalk rw;
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java
index 0c3b720fb6..c2f3c4675a 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java
@@ -78,7 +78,7 @@ class Checkout extends TextBuiltin {
private String name;
@Option(name = "--", metaVar = "metaVar_paths", multiValued = true, handler = RestOfArgumentsHandler.class)
- private List<String> paths = new ArrayList<String>();
+ private List<String> paths = new ArrayList<>();
@Override
protected void run() throws Exception {
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 2673cc887d..cf4c6e3339 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
@@ -100,7 +100,7 @@ public class CommandCatalog {
* @return all common commands, sorted by command name.
*/
public static CommandRef[] common() {
- final ArrayList<CommandRef> common = new ArrayList<CommandRef>();
+ final ArrayList<CommandRef> common = new ArrayList<>();
for (final CommandRef c : INSTANCE.commands.values())
if (c.isCommon())
common.add(c);
@@ -110,6 +110,7 @@ public class CommandCatalog {
private static CommandRef[] toSortedArray(final Collection<CommandRef> c) {
final CommandRef[] r = c.toArray(new CommandRef[c.size()]);
Arrays.sort(r, new Comparator<CommandRef>() {
+ @Override
public int compare(final CommandRef o1, final CommandRef o2) {
return o1.getName().compareTo(o2.getName());
}
@@ -123,7 +124,7 @@ public class CommandCatalog {
private CommandCatalog() {
ldr = Thread.currentThread().getContextClassLoader();
- commands = new HashMap<String, CommandRef>();
+ commands = new HashMap<>();
final Enumeration<URL> catalogs = catalogs();
while (catalogs.hasMoreElements())
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java
index 2cfbd86fa3..befc4ec272 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java
@@ -75,7 +75,7 @@ class Commit extends TextBuiltin {
private boolean amend;
@Argument(metaVar = "metaVar_commitPaths", usage = "usage_CommitPaths")
- private List<String> paths = new ArrayList<String>();
+ private List<String> paths = new ArrayList<>();
@Override
protected void run() throws NoHeadException, NoMessageException,
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Daemon.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Daemon.java
index a7bdde9f66..1008593be3 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Daemon.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Daemon.java
@@ -87,16 +87,16 @@ class Daemon extends TextBuiltin {
int timeout = -1;
@Option(name = "--enable", metaVar = "metaVar_service", usage = "usage_enableTheServiceInAllRepositories", multiValued = true)
- final List<String> enable = new ArrayList<String>();
+ final List<String> enable = new ArrayList<>();
@Option(name = "--disable", metaVar = "metaVar_service", usage = "usage_disableTheServiceInAllRepositories", multiValued = true)
- final List<String> disable = new ArrayList<String>();
+ final List<String> disable = new ArrayList<>();
@Option(name = "--allow-override", metaVar = "metaVar_service", usage = "usage_configureTheServiceInDaemonServicename", multiValued = true)
- final List<String> canOverride = new ArrayList<String>();
+ final List<String> canOverride = new ArrayList<>();
@Option(name = "--forbid-override", metaVar = "metaVar_service", usage = "usage_configureTheServiceInDaemonServicename", multiValued = true)
- final List<String> forbidOverride = new ArrayList<String>();
+ final List<String> forbidOverride = new ArrayList<>();
@Option(name = "--export-all", usage = "usage_exportWithoutGitDaemonExportOk")
boolean exportAll;
@@ -109,7 +109,7 @@ class Daemon extends TextBuiltin {
}
@Argument(required = true, metaVar = "metaVar_directory", usage = "usage_directoriesToExport")
- final List<File> directory = new ArrayList<File>();
+ final List<File> directory = new ArrayList<>();
@Override
protected boolean requiresRepository() {
@@ -139,7 +139,7 @@ class Daemon extends TextBuiltin {
if (1 < threads)
packConfig.setExecutor(Executors.newFixedThreadPool(threads));
- final FileResolver<DaemonClient> resolver = new FileResolver<DaemonClient>();
+ final FileResolver<DaemonClient> resolver = new FileResolver<>();
for (final File f : directory) {
outw.println(MessageFormat.format(CLIText.get().exporting, f.getAbsolutePath()));
resolver.exportDirectory(f);
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/DiffTree.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/DiffTree.java
index 95c2132435..56b62418c0 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/DiffTree.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/DiffTree.java
@@ -67,7 +67,7 @@ class DiffTree extends TextBuiltin {
}
@Argument(index = 1, metaVar = "metaVar_treeish", required = true)
- private final List<AbstractTreeIterator> trees = new ArrayList<AbstractTreeIterator>();
+ private final List<AbstractTreeIterator> trees = new ArrayList<>();
@Option(name = "--", metaVar = "metaVar_path", multiValued = true, handler = PathTreeFilterHandler.class)
private TreeFilter pathFilter = TreeFilter.ALL;
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Gc.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Gc.java
index bf454760af..7289abb62f 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Gc.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Gc.java
@@ -52,10 +52,18 @@ class Gc extends TextBuiltin {
@Option(name = "--aggressive", usage = "usage_Aggressive")
private boolean aggressive;
+ @Option(name = "--preserve-oldpacks", usage = "usage_PreserveOldPacks")
+ private boolean preserveOldPacks;
+
+ @Option(name = "--prune-preserved", usage = "usage_PrunePreserved")
+ private boolean prunePreserved;
+
@Override
protected void run() throws Exception {
Git git = Git.wrap(db);
git.gc().setAggressive(aggressive)
+ .setPreserveOldPacks(preserveOldPacks)
+ .setPrunePreserved(prunePreserved)
.setProgressMonitor(new TextProgressMonitor(errw)).call();
}
}
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Glog.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Glog.java
index f07c3ca8b5..7b715751da 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Glog.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Glog.java
@@ -88,6 +88,7 @@ class Glog extends RevWalkTextBuiltin {
final JButton repaint = new JButton();
repaint.setText(CLIText.get().repaint);
repaint.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent e) {
graphPane.repaint();
}
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java
index 62e77285b9..1108ddd10b 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java
@@ -53,6 +53,7 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.Set;
@@ -93,7 +94,7 @@ class Log extends RevWalkTextBuiltin {
@Option(name = "--no-standard-notes", usage = "usage_noShowStandardNotes")
private boolean noStandardNotes;
- private List<String> additionalNoteRefs = new ArrayList<String>();
+ private List<String> additionalNoteRefs = new ArrayList<>();
@Option(name = "--show-notes", usage = "usage_showNotes", metaVar = "metaVar_ref")
void addAdditionalNoteRef(String notesRef) {
@@ -102,8 +103,8 @@ class Log extends RevWalkTextBuiltin {
@Option(name = "--date", usage = "usage_date")
void dateFormat(String date) {
- if (date.toLowerCase().equals(date))
- date = date.toUpperCase();
+ if (date.toLowerCase(Locale.ROOT).equals(date))
+ date = date.toUpperCase(Locale.ROOT);
dateFormatter = new GitDateFormatter(Format.valueOf(date));
}
@@ -203,7 +204,7 @@ class Log extends RevWalkTextBuiltin {
if (!noStandardNotes || !additionalNoteRefs.isEmpty()) {
createWalk();
- noteMaps = new LinkedHashMap<String, NoteMap>();
+ noteMaps = new LinkedHashMap<>();
if (!noStandardNotes) {
addNoteMap(Constants.R_NOTES_COMMITS);
}
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java
index 6262ad2469..7a5f3d8116 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java
@@ -74,8 +74,9 @@ class LsRemote extends TextBuiltin {
protected void run() throws Exception {
LsRemoteCommand command = Git.lsRemoteRepository().setRemote(remote)
.setTimeout(timeout).setHeads(heads).setTags(tags);
- TreeSet<Ref> refs = new TreeSet<Ref>(new Comparator<Ref>() {
+ TreeSet<Ref> refs = new TreeSet<>(new Comparator<Ref>() {
+ @Override
public int compare(Ref r1, Ref r2) {
return r1.getName().compareTo(r2.getName());
}
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsTree.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsTree.java
index 872ea67774..02d61e53e2 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsTree.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsTree.java
@@ -68,7 +68,7 @@ class LsTree extends TextBuiltin {
@Argument(index = 1)
@Option(name = "--", metaVar = "metaVar_paths", multiValued = true, handler = StopOptionHandler.class)
- private List<String> paths = new ArrayList<String>();
+ private List<String> paths = new ArrayList<>();
@Override
protected void run() throws Exception {
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java
index a0f4d06d40..3addecb2f9 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java
@@ -53,6 +53,7 @@ import java.net.URL;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
+import java.util.Locale;
import org.eclipse.jgit.awtui.AwtAuthenticator;
import org.eclipse.jgit.awtui.AwtCredentialsProvider;
@@ -90,7 +91,7 @@ public class Main {
private TextBuiltin subcommand;
@Argument(index = 1, metaVar = "metaVar_arg")
- private List<String> arguments = new ArrayList<String>();
+ private List<String> arguments = new ArrayList<>();
PrintWriter writer;
@@ -240,7 +241,8 @@ public class Main {
}
if (version) {
- String cmdId = Version.class.getSimpleName().toLowerCase();
+ String cmdId = Version.class.getSimpleName()
+ .toLowerCase(Locale.ROOT);
subcommand = CommandCatalog.get(cmdId).create();
}
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/MergeBase.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/MergeBase.java
index 9dcd5129b6..f8bae1d8be 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/MergeBase.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/MergeBase.java
@@ -63,7 +63,7 @@ class MergeBase extends TextBuiltin {
}
@Argument(index = 1, metaVar = "metaVar_commitish", required = true)
- private final List<RevCommit> commits = new ArrayList<RevCommit>();
+ private final List<RevCommit> commits = new ArrayList<>();
@Override
protected void run() throws Exception {
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
index 98af186b2f..1b805d16fc 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
@@ -77,7 +77,7 @@ class Push extends TextBuiltin {
private String remote = Constants.DEFAULT_REMOTE_NAME;
@Argument(index = 1, metaVar = "metaVar_refspec")
- private final List<RefSpec> refSpecs = new ArrayList<RefSpec>();
+ private final List<RefSpec> refSpecs = new ArrayList<>();
@Option(name = "--all")
private boolean all;
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevParse.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevParse.java
index 6833ad3c05..a66b7fa639 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevParse.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevParse.java
@@ -68,7 +68,7 @@ class RevParse extends TextBuiltin {
boolean verify;
@Argument(index = 0, metaVar = "metaVar_commitish")
- private final List<ObjectId> commits = new ArrayList<ObjectId>();
+ private final List<ObjectId> commits = new ArrayList<>();
@Override
protected void run() throws Exception {
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java
index 1543586802..74135e4bae 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java
@@ -124,12 +124,12 @@ abstract class RevWalkTextBuiltin extends TextBuiltin {
private String followPath;
@Argument(index = 0, metaVar = "metaVar_commitish")
- private final List<RevCommit> commits = new ArrayList<RevCommit>();
+ private final List<RevCommit> commits = new ArrayList<>();
@Option(name = "--", metaVar = "metaVar_path", multiValued = true, handler = PathTreeFilterHandler.class)
protected TreeFilter pathFilter = TreeFilter.ALL;
- private final List<RevFilter> revLimiter = new ArrayList<RevFilter>();
+ private final List<RevFilter> revLimiter = new ArrayList<>();
@Option(name = "--author")
void addAuthorRevFilter(final String who) {
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Rm.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Rm.java
index f4f864b397..79c3f094e8 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Rm.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Rm.java
@@ -58,7 +58,7 @@ class Rm extends TextBuiltin {
@Argument(metaVar = "metaVar_path", usage = "usage_path", multiValued = true, required = true)
@Option(name = "--", handler = StopOptionHandler.class)
- private List<String> paths = new ArrayList<String>();
+ private List<String> paths = new ArrayList<>();
@Override
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java
index 43b292e39c..b7f5e58285 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java
@@ -117,7 +117,7 @@ class Status extends TextBuiltin {
Map<String, StageState> conflicting = status.getConflictingStageState();
// build a sorted list of all paths except untracked and ignored
- TreeSet<String> sorted = new TreeSet<String>();
+ TreeSet<String> sorted = new TreeSet<>();
sorted.addAll(added);
sorted.addAll(changed);
sorted.addAll(removed);
@@ -185,7 +185,7 @@ class Status extends TextBuiltin {
// untracked are always at the end of the list
if ("all".equals(untrackedFilesMode)) { //$NON-NLS-1$
- TreeSet<String> untracked = new TreeSet<String>(
+ TreeSet<String> untracked = new TreeSet<>(
status.getUntracked());
for (String path : untracked)
printPorcelainLine('?', '?', path);
@@ -221,7 +221,7 @@ class Status extends TextBuiltin {
Collection<String> untracked = status.getUntracked();
Map<String, StageState> unmergedStates = status
.getConflictingStageState();
- Collection<String> toBeCommitted = new ArrayList<String>(added);
+ Collection<String> toBeCommitted = new ArrayList<>(added);
toBeCommitted.addAll(changed);
toBeCommitted.addAll(removed);
int nbToBeCommitted = toBeCommitted.size();
@@ -232,7 +232,7 @@ class Status extends TextBuiltin {
toBeCommitted, added, changed, removed);
firstHeader = false;
}
- Collection<String> notStagedForCommit = new ArrayList<String>(modified);
+ Collection<String> notStagedForCommit = new ArrayList<>(modified);
notStagedForCommit.addAll(missing);
int nbNotStagedForCommit = notStagedForCommit.size();
if (nbNotStagedForCommit > 0) {
@@ -274,7 +274,7 @@ class Status extends TextBuiltin {
protected int printList(Collection<String> list) throws IOException {
if (!list.isEmpty()) {
- List<String> sortedList = new ArrayList<String>(list);
+ List<String> sortedList = new ArrayList<>(list);
java.util.Collections.sort(sortedList);
for (String filename : sortedList) {
outw.println(CLIText.formatLine(String.format(
@@ -291,7 +291,7 @@ class Status extends TextBuiltin {
Collection<String> set2,
@SuppressWarnings("unused") Collection<String> set3)
throws IOException {
- List<String> sortedList = new ArrayList<String>(list);
+ List<String> sortedList = new ArrayList<>(list);
java.util.Collections.sort(sortedList);
for (String filename : sortedList) {
String prefix;
@@ -311,7 +311,7 @@ class Status extends TextBuiltin {
private void printUnmerged(Map<String, StageState> unmergedStates)
throws IOException {
- List<String> paths = new ArrayList<String>(unmergedStates.keySet());
+ List<String> paths = new ArrayList<>(unmergedStates.keySet());
Collections.sort(paths);
for (String path : paths) {
StageState state = unmergedStates.get(path);
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java
index 05d094f0de..44ec3f413c 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java
@@ -84,12 +84,14 @@ import org.kohsuke.args4j.Option;
class DiffAlgorithms extends TextBuiltin {
final Algorithm myers = new Algorithm() {
+ @Override
DiffAlgorithm create() {
return MyersDiff.INSTANCE;
}
};
final Algorithm histogram = new Algorithm() {
+ @Override
DiffAlgorithm create() {
HistogramDiff d = new HistogramDiff();
d.setFallbackAlgorithm(null);
@@ -98,6 +100,7 @@ class DiffAlgorithms extends TextBuiltin {
};
final Algorithm histogram_myers = new Algorithm() {
+ @Override
DiffAlgorithm create() {
HistogramDiff d = new HistogramDiff();
d.setFallbackAlgorithm(MyersDiff.INSTANCE);
@@ -112,13 +115,13 @@ class DiffAlgorithms extends TextBuiltin {
//
@Option(name = "--algorithm", multiValued = true, metaVar = "NAME", usage = "Enable algorithm(s)")
- List<String> algorithms = new ArrayList<String>();
+ List<String> algorithms = new ArrayList<>();
@Option(name = "--text-limit", metaVar = "LIMIT", usage = "Maximum size in KiB to scan per file revision")
int textLimit = 15 * 1024; // 15 MiB as later we do * 1024.
@Option(name = "--repository", aliases = { "-r" }, multiValued = true, metaVar = "GIT_DIR", usage = "Repository to scan")
- List<File> gitDirs = new ArrayList<File>();
+ List<File> gitDirs = new ArrayList<>();
@Option(name = "--count", metaVar = "LIMIT", usage = "Number of file revisions to be compared")
int count = 0; // unlimited
@@ -234,6 +237,7 @@ class DiffAlgorithms extends TextBuiltin {
}
Collections.sort(all, new Comparator<Test>() {
+ @Override
public int compare(Test a, Test b) {
int result = Long.signum(a.runningTimeNanos - b.runningTimeNanos);
if (result == 0) {
@@ -320,7 +324,7 @@ class DiffAlgorithms extends TextBuiltin {
}
private List<Test> init() {
- List<Test> all = new ArrayList<Test>();
+ List<Test> all = new ArrayList<>();
try {
for (Field f : DiffAlgorithms.class.getDeclaredFields()) {
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/LfsStore.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/LfsStore.java
index 52b6d190dd..5839f3395b 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/LfsStore.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/LfsStore.java
@@ -219,6 +219,7 @@ class LfsStore extends TextBuiltin {
return false;
}
+ @Override
protected void run() throws Exception {
AppServer server = new AppServer(port);
URI baseURI = server.getURI();
@@ -254,7 +255,7 @@ class LfsStore extends TextBuiltin {
@Override
protected LargeFileRepository getLargeFileRepository(
- LfsRequest request, String path) {
+ LfsRequest request, String path, String auth) {
return repository;
}
};
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java
index 8cfcba9113..da602d0b89 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java
@@ -112,7 +112,7 @@ class RebuildCommitGraph extends TextBuiltin {
private final ProgressMonitor pm = new TextProgressMonitor(errw);
- private Map<ObjectId, ObjectId> rewrites = new HashMap<ObjectId, ObjectId>();
+ private Map<ObjectId, ObjectId> rewrites = new HashMap<>();
@Override
protected void run() throws Exception {
@@ -137,8 +137,8 @@ class RebuildCommitGraph extends TextBuiltin {
}
private void recreateCommitGraph() throws IOException {
- final Map<ObjectId, ToRewrite> toRewrite = new HashMap<ObjectId, ToRewrite>();
- List<ToRewrite> queue = new ArrayList<ToRewrite>();
+ final Map<ObjectId, ToRewrite> toRewrite = new HashMap<>();
+ List<ToRewrite> queue = new ArrayList<>();
try (RevWalk rw = new RevWalk(db);
final BufferedReader br = new BufferedReader(
new InputStreamReader(new FileInputStream(graph),
@@ -176,7 +176,7 @@ class RebuildCommitGraph extends TextBuiltin {
while (!queue.isEmpty()) {
final ListIterator<ToRewrite> itr = queue
.listIterator(queue.size());
- queue = new ArrayList<ToRewrite>();
+ queue = new ArrayList<>();
REWRITE: while (itr.hasPrevious()) {
final ToRewrite t = itr.previous();
final ObjectId[] newParents = new ObjectId[t.oldParents.length];
@@ -278,7 +278,7 @@ class RebuildCommitGraph extends TextBuiltin {
}
private Map<String, Ref> computeNewRefs() throws IOException {
- final Map<String, Ref> refs = new HashMap<String, Ref>();
+ final Map<String, Ref> refs = new HashMap<>();
try (RevWalk rw = new RevWalk(db);
BufferedReader br = new BufferedReader(
new InputStreamReader(new FileInputStream(refList),
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCommands.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCommands.java
index aa258073b6..415c7d320f 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCommands.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCommands.java
@@ -85,6 +85,7 @@ class ShowCommands extends TextBuiltin {
static enum Format {
/** */
USAGE {
+ @Override
void print(ThrowingPrintWriter err, final CommandRef c) throws IOException {
String usage = c.getUsage();
if (usage != null && usage.length() > 0)
@@ -94,6 +95,7 @@ class ShowCommands extends TextBuiltin {
/** */
CLASSES {
+ @Override
void print(ThrowingPrintWriter err, final CommandRef c) throws IOException {
err.print(c.getImplementationClassName());
}
@@ -101,6 +103,7 @@ class ShowCommands extends TextBuiltin {
/** */
URLS {
+ @Override
void print(ThrowingPrintWriter err, final CommandRef c) throws IOException {
final ClassLoader ldr = c.getImplementationClassLoader();
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java
index 28d92aeca1..0eb4e05c55 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java
@@ -251,16 +251,16 @@ class TextHashFunctions extends TextBuiltin {
//
@Option(name = "--hash", multiValued = true, metaVar = "NAME", usage = "Enable hash function(s)")
- List<String> hashFunctions = new ArrayList<String>();
+ List<String> hashFunctions = new ArrayList<>();
@Option(name = "--fold", multiValued = true, metaVar = "NAME", usage = "Enable fold function(s)")
- List<String> foldFunctions = new ArrayList<String>();
+ List<String> foldFunctions = new ArrayList<>();
@Option(name = "--text-limit", metaVar = "LIMIT", usage = "Maximum size in KiB to scan")
int textLimit = 15 * 1024; // 15 MiB as later we do * 1024.
@Option(name = "--repository", aliases = { "-r" }, multiValued = true, metaVar = "GIT_DIR", usage = "Repository to scan")
- List<File> gitDirs = new ArrayList<File>();
+ List<File> gitDirs = new ArrayList<>();
@Override
protected boolean requiresRepository() {
@@ -327,7 +327,7 @@ class TextHashFunctions extends TextBuiltin {
RawText txt = new RawText(raw);
int[] lines = new int[txt.size()];
int cnt = 0;
- HashSet<Line> u = new HashSet<Line>();
+ HashSet<Line> u = new HashSet<>();
for (int i = 0; i < txt.size(); i++) {
if (u.add(new Line(txt, i)))
lines[cnt++] = i;
@@ -386,8 +386,8 @@ class TextHashFunctions extends TextBuiltin {
}
private List<Function> init() {
- List<Hash> hashes = new ArrayList<Hash>();
- List<Fold> folds = new ArrayList<Fold>();
+ List<Hash> hashes = new ArrayList<>();
+ List<Fold> folds = new ArrayList<>();
try {
for (Field f : TextHashFunctions.class.getDeclaredFields()) {
@@ -410,7 +410,7 @@ class TextHashFunctions extends TextBuiltin {
throw new RuntimeException("Cannot determine names", e); //$NON-NLS-1$
}
- List<Function> all = new ArrayList<Function>();
+ List<Function> all = new ArrayList<>();
for (Hash cmp : hashes) {
if (include(cmp.name, hashFunctions)) {
for (Fold f : folds) {
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/internal/CLIText.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/internal/CLIText.java
index 90c03e99b5..4842b98731 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/internal/CLIText.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/internal/CLIText.java
@@ -68,7 +68,6 @@ public class CLIText extends TranslationBundle {
* @param line
* the line to format
* @return the formatted line
- * @since 2.2
*/
public static String formatLine(String line) {
return MessageFormat.format(get().lineFormat, line);
@@ -81,7 +80,6 @@ public class CLIText extends TranslationBundle {
* @param message
* the message to format
* @return the formatted line
- * @since 4.2
*/
public static String fatalError(String message) {
return MessageFormat.format(get().fatalError, message);
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/CmdLineParser.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/CmdLineParser.java
index b531ba65a4..020b62580f 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/CmdLineParser.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/CmdLineParser.java
@@ -141,7 +141,7 @@ public class CmdLineParser extends org.kohsuke.args4j.CmdLineParser {
@Override
public void parseArgument(final String... args) throws CmdLineException {
- final ArrayList<String> tmp = new ArrayList<String>(args.length);
+ final ArrayList<String> tmp = new ArrayList<>(args.length);
for (int argi = 0; argi < args.length; argi++) {
final String str = args[argi];
if (str.equals("--")) { //$NON-NLS-1$
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/PathTreeFilterHandler.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/PathTreeFilterHandler.java
index e468023448..b873c3dc2c 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/PathTreeFilterHandler.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/PathTreeFilterHandler.java
@@ -81,7 +81,7 @@ public class PathTreeFilterHandler extends OptionHandler<TreeFilter> {
@Override
public int parseArguments(final Parameters params) throws CmdLineException {
- final List<PathFilter> filters = new ArrayList<PathFilter>();
+ final List<PathFilter> filters = new ArrayList<>();
for (int idx = 0;; idx++) {
final String path;
try {
diff --git a/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs
index 10c29d5576..64f74989e1 100644
--- a/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs
@@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -76,7 +76,7 @@ org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
diff --git a/org.eclipse.jgit.test/BUCK b/org.eclipse.jgit.test/BUCK
deleted file mode 100644
index 5b7be89b1e..0000000000
--- a/org.eclipse.jgit.test/BUCK
+++ /dev/null
@@ -1,95 +0,0 @@
-PKG = 'tst/org/eclipse/jgit/'
-HELPERS = glob(['src/**/*.java']) + [PKG + c for c in [
- 'api/AbstractRemoteCommandTest.java',
- 'diff/AbstractDiffTestCase.java',
- 'internal/storage/file/GcTestCase.java',
- 'internal/storage/file/PackIndexTestCase.java',
- 'internal/storage/file/XInputStream.java',
- 'nls/GermanTranslatedBundle.java',
- 'nls/MissingPropertyBundle.java',
- 'nls/NoPropertiesBundle.java',
- 'nls/NonTranslatedBundle.java',
- 'revwalk/RevQueueTestCase.java',
- 'revwalk/RevWalkTestCase.java',
- 'transport/SpiTransport.java',
- 'treewalk/FileTreeIteratorWithTimeControl.java',
- 'treewalk/filter/AlwaysCloneTreeFilter.java',
- 'test/resources/SampleDataRepositoryTestCase.java',
- 'util/CPUTimeStopWatch.java',
- 'util/io/Strings.java',
-]]
-
-DATA = [
- PKG + 'lib/empty.gitindex.dat',
- PKG + 'lib/sorttest.gitindex.dat',
-]
-
-TESTS = glob(
- ['tst/**/*.java'],
- excludes = HELPERS + DATA,
-)
-
-DEPS = {
- PKG + 'nls/RootLocaleTest.java': [
- '//org.eclipse.jgit.pgm:pgm',
- '//org.eclipse.jgit.ui:ui',
- ],
-}
-
-for src in TESTS:
- name = src[len('tst/'):len(src)-len('.java')].replace('/', '.')
- labels = []
- if name.startswith('org.eclipse.jgit.'):
- l = name[len('org.eclipse.jgit.'):]
- if l.startswith('internal.storage.'):
- l = l[len('internal.storage.'):]
- i = l.find('.')
- if i > 0:
- labels.append(l[:i])
- else:
- labels.append(i)
- if 'lib' not in labels:
- labels.append('lib')
-
- java_test(
- name = name,
- labels = labels,
- srcs = [src],
- deps = [
- ':helpers',
- ':tst_rsrc',
- '//org.eclipse.jgit:jgit',
- '//org.eclipse.jgit.junit:junit',
- '//org.eclipse.jgit.lfs:jgit-lfs',
- '//lib:hamcrest-core',
- '//lib:hamcrest-library',
- '//lib:javaewah',
- '//lib:junit',
- '//lib:slf4j-api',
- '//lib:slf4j-simple',
- ] + DEPS.get(src, []),
- vm_args = ['-Xmx256m', '-Dfile.encoding=UTF-8'],
- )
-
-java_library(
- name = 'helpers',
- srcs = HELPERS,
- resources = DATA,
- deps = [
- '//org.eclipse.jgit:jgit',
- '//org.eclipse.jgit.junit:junit',
- '//lib:junit',
- ],
-)
-
-prebuilt_jar(
- name = 'tst_rsrc',
- binary_jar = ':tst_rsrc_jar',
-)
-
-genrule(
- name = 'tst_rsrc_jar',
- cmd = 'cd $SRCDIR/tst-rsrc ; zip -qr $OUT .',
- srcs = glob(['tst-rsrc/**']),
- out = 'tst_rsrc.jar',
-)
diff --git a/org.eclipse.jgit.test/BUILD b/org.eclipse.jgit.test/BUILD
new file mode 100644
index 0000000000..bbda838f00
--- /dev/null
+++ b/org.eclipse.jgit.test/BUILD
@@ -0,0 +1,61 @@
+load(":tests.bzl", "tests")
+load(
+ "@com_googlesource_gerrit_bazlets//tools:genrule2.bzl",
+ "genrule2",
+)
+
+PKG = "tst/org/eclipse/jgit/"
+
+HELPERS = glob(["src/**/*.java"]) + [PKG + c for c in [
+ "api/AbstractRemoteCommandTest.java",
+ "diff/AbstractDiffTestCase.java",
+ "internal/storage/file/GcTestCase.java",
+ "internal/storage/file/PackIndexTestCase.java",
+ "internal/storage/file/XInputStream.java",
+ "nls/GermanTranslatedBundle.java",
+ "nls/MissingPropertyBundle.java",
+ "nls/NoPropertiesBundle.java",
+ "nls/NonTranslatedBundle.java",
+ "revwalk/RevQueueTestCase.java",
+ "revwalk/RevWalkTestCase.java",
+ "transport/SpiTransport.java",
+ "treewalk/FileTreeIteratorWithTimeControl.java",
+ "treewalk/filter/AlwaysCloneTreeFilter.java",
+ "test/resources/SampleDataRepositoryTestCase.java",
+ "util/CPUTimeStopWatch.java",
+ "util/io/Strings.java",
+]]
+
+DATA = [
+ PKG + "lib/empty.gitindex.dat",
+ PKG + "lib/sorttest.gitindex.dat",
+]
+
+tests(glob(
+ ["tst/**/*.java"],
+ exclude = HELPERS + DATA,
+))
+
+java_library(
+ name = "helpers",
+ testonly = 1,
+ srcs = HELPERS,
+ resources = DATA,
+ deps = [
+ "//lib:junit",
+ "//org.eclipse.jgit:jgit",
+ "//org.eclipse.jgit.junit:junit",
+ ],
+)
+
+java_import(
+ name = "tst_rsrc",
+ jars = [":tst_rsrc_jar"],
+)
+
+genrule2(
+ name = "tst_rsrc_jar",
+ srcs = glob(["tst-rsrc/**"]),
+ outs = ["tst_rsrc.jar"],
+ cmd = "o=$$PWD/$@ && tar cf - $(SRCS) | tar -C $$TMP --strip-components=2 -xf - && cd $$TMP && zip -qr $$o .",
+)
diff --git a/org.eclipse.jgit.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.test/META-INF/MANIFEST.MF
index f48cae0b80..9a4b3e1894 100644
--- a/org.eclipse.jgit.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.test/META-INF/MANIFEST.MF
@@ -2,53 +2,54 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin_name
Bundle-SymbolicName: org.eclipse.jgit.test
-Bundle-Version: 4.6.2.qualifier
+Bundle-Version: 4.7.8.qualifier
Bundle-Localization: plugin
Bundle-Vendor: %provider_name
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: com.googlecode.javaewah;version="[1.1.6,2.0.0)",
- org.eclipse.jgit.api;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.api.errors;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.attributes;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.awtui;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.blame;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.diff;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.dircache;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.errors;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.events;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.fnmatch;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.gitrepo;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.hooks;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.ignore;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.ignore.internal;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.internal;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.internal.storage.dfs;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.internal.storage.file;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.internal.storage.pack;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.internal.storage.reftree;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.junit;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lfs;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.lib;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.merge;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.nls;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.notes;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.patch;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.pgm;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.pgm.internal;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.revplot;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.revwalk;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.revwalk.filter;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.storage.file;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.storage.pack;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.submodule;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.transport;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.transport.http;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.transport.resolver;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.treewalk;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.treewalk.filter;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.util;version="[4.6.2,4.7.0)",
- org.eclipse.jgit.util.io;version="[4.6.2,4.7.0)",
+ org.eclipse.jgit.api;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.api.errors;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.attributes;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.awtui;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.blame;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.diff;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.dircache;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.errors;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.events;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.fnmatch;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.gitrepo;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.hooks;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.ignore;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.ignore.internal;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.internal;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.internal.storage.dfs;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.internal.storage.file;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.internal.storage.pack;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.internal.storage.reftree;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.junit;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lfs;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.lib;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.merge;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.nls;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.notes;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.patch;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.pgm;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.pgm.internal;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.revplot;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.revwalk;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.revwalk.filter;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.storage.file;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.storage.pack;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.submodule;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.transport;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.transport.http;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.transport.resolver;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.treewalk;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.treewalk.filter;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.util;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.util.io;version="[4.7.8,4.8.0)",
+ org.eclipse.jgit.util.sha1;version="[4.7.8,4.8.0)",
org.junit;version="[4.4.0,5.0.0)",
org.junit.experimental.theories;version="[4.4.0,5.0.0)",
org.junit.rules;version="[4.11.0,5.0.0)",
diff --git a/org.eclipse.jgit.test/exttst/org/eclipse/jgit/patch/EGitPatchHistoryTest.java b/org.eclipse.jgit.test/exttst/org/eclipse/jgit/patch/EGitPatchHistoryTest.java
index 76930f2b86..7c0ea44c35 100644
--- a/org.eclipse.jgit.test/exttst/org/eclipse/jgit/patch/EGitPatchHistoryTest.java
+++ b/org.eclipse.jgit.test/exttst/org/eclipse/jgit/patch/EGitPatchHistoryTest.java
@@ -89,7 +89,7 @@ public class EGitPatchHistoryTest {
super(new String[] { "-p" });
stats = s;
- offBy1 = new HashSet<String>();
+ offBy1 = new HashSet<>();
offBy1.add("9bda5ece6806cd797416eaa47c7b927cc6e9c3b2");
}
@@ -158,7 +158,7 @@ public class EGitPatchHistoryTest {
}
static class NumStatReader extends CommitReader {
- final HashMap<String, HashMap<String, StatInfo>> stats = new HashMap<String, HashMap<String, StatInfo>>();
+ final HashMap<String, HashMap<String, StatInfo>> stats = new HashMap<>();
NumStatReader() throws IOException {
super(new String[] { "--numstat" });
@@ -166,7 +166,7 @@ public class EGitPatchHistoryTest {
@Override
void onCommit(String commitId, byte[] buf) {
- final HashMap<String, StatInfo> files = new HashMap<String, StatInfo>();
+ final HashMap<String, StatInfo> files = new HashMap<>();
final MutableInteger ptr = new MutableInteger();
while (ptr.value < buf.length) {
if (buf[ptr.value] == '\n')
diff --git a/org.eclipse.jgit.test/pom.xml b/org.eclipse.jgit.test/pom.xml
index 1aff2898b2..59b1207637 100644
--- a/org.eclipse.jgit.test/pom.xml
+++ b/org.eclipse.jgit.test/pom.xml
@@ -52,7 +52,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit-parent</artifactId>
- <version>4.6.2-SNAPSHOT</version>
+ <version>4.7.8-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.jgit.test</artifactId>
@@ -155,6 +155,10 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx256m -Dfile.encoding=UTF-8 -Djava.io.tmpdir=${project.build.directory}</argLine>
+ <includes>
+ <include>**/*Test.java</include>
+ <include>**/*Tests.java</include>
+ </includes>
</configuration>
</plugin>
</plugins>
diff --git a/org.eclipse.jgit.test/src/org/eclipse/jgit/lib/Sets.java b/org.eclipse.jgit.test/src/org/eclipse/jgit/lib/Sets.java
index 4454e1a393..5a01eae9b5 100644
--- a/org.eclipse.jgit.test/src/org/eclipse/jgit/lib/Sets.java
+++ b/org.eclipse.jgit.test/src/org/eclipse/jgit/lib/Sets.java
@@ -49,7 +49,7 @@ import java.util.Set;
public class Sets {
@SafeVarargs
public static <T> Set<T> of(T... elements) {
- Set<T> ret = new HashSet<T>();
+ Set<T> ret = new HashSet<>();
for (T element : elements)
ret.add(element);
return ret;
diff --git a/org.eclipse.jgit.test/tests.bzl b/org.eclipse.jgit.test/tests.bzl
new file mode 100644
index 0000000000..8ae0065a4c
--- /dev/null
+++ b/org.eclipse.jgit.test/tests.bzl
@@ -0,0 +1,48 @@
+load(
+ "@com_googlesource_gerrit_bazlets//tools:junit.bzl",
+ "junit_tests",
+)
+
+def tests(tests):
+ for src in tests:
+ name = src[len("tst/"):len(src) - len(".java")].replace("/", "_")
+ labels = []
+ if name.startswith("org_eclipse_jgit_"):
+ l = name[len("org.eclipse.jgit_"):]
+ if l.startswith("internal_storage_"):
+ l = l[len("internal.storage_"):]
+ i = l.find("_")
+ if i > 0:
+ labels.append(l[:i])
+ else:
+ labels.append(i)
+ if "lib" not in labels:
+ labels.append("lib")
+
+ additional_deps = []
+ if src.endswith("RootLocaleTest.java"):
+ additional_deps = [
+ "//org.eclipse.jgit.pgm:pgm",
+ "//org.eclipse.jgit.ui:ui",
+ ]
+ if src.endswith("WalkEncryptionTest.java"):
+ additional_deps = [
+ "//org.eclipse.jgit:insecure_cipher_factory",
+ ]
+
+ junit_tests(
+ name = name,
+ tags = labels,
+ srcs = [src],
+ deps = additional_deps + [
+ ":helpers",
+ ":tst_rsrc",
+ "//lib:javaewah",
+ "//lib:junit",
+ "//lib:slf4j-api",
+ "//org.eclipse.jgit:jgit",
+ "//org.eclipse.jgit.junit:junit",
+ "//org.eclipse.jgit.lfs:jgit-lfs",
+ ],
+ jvm_flags = ["-Xmx256m", "-Dfile.encoding=UTF-8"],
+ )
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/util/sha1/shattered-1.pdf b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/util/sha1/shattered-1.pdf
new file mode 100644
index 0000000000..ba9aaa145c
--- /dev/null
+++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/util/sha1/shattered-1.pdf
Binary files differ
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/util/sha1/shattered-2.pdf b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/util/sha1/shattered-2.pdf
new file mode 100644
index 0000000000..b621eeccd5
--- /dev/null
+++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/util/sha1/shattered-2.pdf
Binary files differ
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 5ad73f17b0..ed3907e9b2 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
@@ -1074,30 +1074,37 @@ public class AddCommandTest extends RepositoryTestCase {
FS executableFs = new FS() {
+ @Override
public boolean supportsExecute() {
return true;
}
+ @Override
public boolean setExecute(File f, boolean canExec) {
return true;
}
+ @Override
public ProcessBuilder runInShell(String cmd, String[] args) {
return null;
}
+ @Override
public boolean retryFailedLockFileCommit() {
return false;
}
+ @Override
public FS newInstance() {
return this;
}
+ @Override
protected File discoverGitExe() {
return null;
}
+ @Override
public boolean canExecute(File f) {
try {
return read(f).startsWith("binary:");
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ArchiveCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ArchiveCommandTest.java
index fc8df42e26..edab96b971 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ArchiveCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ArchiveCommandTest.java
@@ -57,6 +57,7 @@ import java.util.Map;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.junit.RepositoryTestCase;
import org.eclipse.jgit.lib.FileMode;
+import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectLoader;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.util.StringUtils;
@@ -78,6 +79,7 @@ public class ArchiveCommandTest extends RepositoryTestCase {
ArchiveCommand.registerFormat(format.SUFFIXES.get(0), format);
}
+ @Override
@After
public void tearDown() {
ArchiveCommand.unregisterFormat(format.SUFFIXES.get(0));
@@ -190,7 +192,7 @@ public class ArchiveCommandTest extends RepositoryTestCase {
private class MockFormat implements ArchiveCommand.Format<MockOutputStream> {
- private Map<String, String> entries = new HashMap<String, String>();
+ private Map<String, String> entries = new HashMap<>();
private int size() {
return entries.size();
@@ -203,12 +205,14 @@ public class ArchiveCommandTest extends RepositoryTestCase {
private final List<String> SUFFIXES = Collections
.unmodifiableList(Arrays.asList(".mck"));
+ @Override
public MockOutputStream createArchiveOutputStream(OutputStream s)
throws IOException {
return createArchiveOutputStream(s,
Collections.<String, Object> emptyMap());
}
+ @Override
public MockOutputStream createArchiveOutputStream(OutputStream s,
Map<String, Object> o) throws IOException {
for (Map.Entry<String, Object> p : o.entrySet()) {
@@ -224,11 +228,18 @@ public class ArchiveCommandTest extends RepositoryTestCase {
return new MockOutputStream();
}
+ @Override
public void putEntry(MockOutputStream out, String path, FileMode mode, ObjectLoader loader) {
+ putEntry(out, null, path, mode, loader);
+ }
+
+ @Override
+ public void putEntry(MockOutputStream out, ObjectId tree, String path, FileMode mode, ObjectLoader loader) {
String content = mode != FileMode.TREE ? new String(loader.getBytes()) : null;
entries.put(path, content);
}
+ @Override
public Iterable<String> suffixes() {
return SUFFIXES;
}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java
index 0e1cf02c86..85436db472 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java
@@ -64,6 +64,7 @@ import org.junit.Test;
public class CleanCommandTest extends RepositoryTestCase {
private Git git;
+ @Override
@Before
public void setUp() throws Exception {
super.setUp();
@@ -143,7 +144,7 @@ public class CleanCommandTest extends RepositoryTestCase {
assertTrue(files.size() > 0);
// run clean with setPaths
- Set<String> paths = new TreeSet<String>();
+ Set<String> paths = new TreeSet<>();
paths.add("File3.txt");
Set<String> cleanedFiles = git.clean().setPaths(paths).call();
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CloneCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CloneCommandTest.java
index 8a728caf73..ae0b8dd3c2 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CloneCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CloneCommandTest.java
@@ -85,9 +85,10 @@ public class CloneCommandTest extends RepositoryTestCase {
private TestRepository<Repository> tr;
+ @Override
public void setUp() throws Exception {
super.setUp();
- tr = new TestRepository<Repository>(db);
+ tr = new TestRepository<>(db);
git = new Git(db);
// commit something
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java
index 021c245d4e..37fee402e9 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java
@@ -93,30 +93,37 @@ public class CommitCommandTest extends RepositoryTestCase {
FS executableFs = new FS() {
+ @Override
public boolean supportsExecute() {
return true;
}
+ @Override
public boolean setExecute(File f, boolean canExec) {
return true;
}
+ @Override
public ProcessBuilder runInShell(String cmd, String[] args) {
return null;
}
+ @Override
public boolean retryFailedLockFileCommit() {
return false;
}
+ @Override
public FS newInstance() {
return this;
}
+ @Override
protected File discoverGitExe() {
return null;
}
+ @Override
public boolean canExecute(File f) {
return true;
}
@@ -138,30 +145,37 @@ public class CommitCommandTest extends RepositoryTestCase {
FS nonExecutableFs = new FS() {
+ @Override
public boolean supportsExecute() {
return false;
}
+ @Override
public boolean setExecute(File f, boolean canExec) {
return false;
}
+ @Override
public ProcessBuilder runInShell(String cmd, String[] args) {
return null;
}
+ @Override
public boolean retryFailedLockFileCommit() {
return false;
}
+ @Override
public FS newInstance() {
return this;
}
+ @Override
protected File discoverGitExe() {
return null;
}
+ @Override
public boolean canExecute(File f) {
return false;
}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/EolRepositoryTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/EolRepositoryTest.java
index 5f10131750..48d373344e 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/EolRepositoryTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/EolRepositoryTest.java
@@ -623,6 +623,7 @@ public class EolRepositoryTest extends RepositoryTestCase {
for (int i = 0; i < dc.getEntryCount(); i++) {
editor.add(new DirCacheEditor.PathEdit(
dc.getEntry(i).getPathString()) {
+ @Override
public void apply(DirCacheEntry ent) {
ent.smudgeRacilyClean();
}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/FetchAndPullCommandsRecurseSubmodulesTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/FetchAndPullCommandsRecurseSubmodulesTest.java
new file mode 100644
index 0000000000..73a705b252
--- /dev/null
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/FetchAndPullCommandsRecurseSubmodulesTest.java
@@ -0,0 +1,361 @@
+/*
+ * Copyright (C) 2017 David Pursehouse <david.pursehouse@gmail.com>
+ * 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 v1.0 which
+ * accompanies this distribution, is reproduced below, and is
+ * available at http://www.eclipse.org/org/documents/edl-v10.php
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * - Neither the name of the Eclipse Foundation, Inc. nor the
+ * names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.eclipse.jgit.api;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+
+import org.eclipse.jgit.api.ResetCommand.ResetType;
+import org.eclipse.jgit.junit.JGitTestUtil;
+import org.eclipse.jgit.junit.RepositoryTestCase;
+import org.eclipse.jgit.lib.ConfigConstants;
+import org.eclipse.jgit.lib.Constants;
+import org.eclipse.jgit.lib.ObjectId;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.lib.StoredConfig;
+import org.eclipse.jgit.lib.SubmoduleConfig.FetchRecurseSubmodulesMode;
+import org.eclipse.jgit.revwalk.RevCommit;
+import org.eclipse.jgit.submodule.SubmoduleStatus;
+import org.eclipse.jgit.submodule.SubmoduleStatusType;
+import org.eclipse.jgit.submodule.SubmoduleWalk;
+import org.eclipse.jgit.transport.FetchResult;
+import org.eclipse.jgit.transport.RefSpec;
+import org.junit.Before;
+import org.junit.experimental.theories.DataPoints;
+import org.junit.experimental.theories.Theories;
+import org.junit.experimental.theories.Theory;
+import org.junit.runner.RunWith;
+
+@RunWith(Theories.class)
+public class FetchAndPullCommandsRecurseSubmodulesTest extends RepositoryTestCase {
+ @DataPoints
+ public static boolean[] useFetch = { true, false };
+
+ private Git git;
+
+ private Git git2;
+
+ private Git sub1Git;
+
+ private Git sub2Git;
+
+ private RevCommit commit1;
+
+ private RevCommit commit2;
+
+ private ObjectId submodule1Head;
+
+ private ObjectId submodule2Head;
+
+ private final RefSpec REFSPEC = new RefSpec("refs/heads/master");
+
+ private final String REMOTE = "origin";
+
+ private final String PATH = "sub";
+
+ @Before
+ public void setUpSubmodules() throws Exception {
+ git = new Git(db);
+
+ // Create submodule 1
+ File submodule1 = createTempDirectory(
+ "testCloneRepositoryWithNestedSubmodules1");
+ sub1Git = Git.init().setDirectory(submodule1).call();
+ assertNotNull(sub1Git);
+ Repository sub1 = sub1Git.getRepository();
+ assertNotNull(sub1);
+ addRepoToClose(sub1);
+
+ String file = "file.txt";
+
+ write(new File(sub1.getWorkTree(), file), "content");
+ sub1Git.add().addFilepattern(file).call();
+ RevCommit commit = sub1Git.commit().setMessage("create file").call();
+ assertNotNull(commit);
+
+ // Create submodule 2
+ File submodule2 = createTempDirectory(
+ "testCloneRepositoryWithNestedSubmodules2");
+ sub2Git = Git.init().setDirectory(submodule2).call();
+ assertNotNull(sub2Git);
+ Repository sub2 = sub2Git.getRepository();
+ assertNotNull(sub2);
+ addRepoToClose(sub2);
+
+ write(new File(sub2.getWorkTree(), file), "content");
+ sub2Git.add().addFilepattern(file).call();
+ RevCommit sub2Head = sub2Git.commit().setMessage("create file").call();
+ assertNotNull(sub2Head);
+
+ // Add submodule 2 to submodule 1
+ Repository r2 = sub1Git.submoduleAdd().setPath(PATH)
+ .setURI(sub2.getDirectory().toURI().toString()).call();
+ assertNotNull(r2);
+ addRepoToClose(r2);
+ RevCommit sub1Head = sub1Git.commit().setAll(true)
+ .setMessage("Adding submodule").call();
+ assertNotNull(sub1Head);
+
+ // Add submodule 1 to default repository
+ Repository r1 = git.submoduleAdd().setPath(PATH)
+ .setURI(sub1.getDirectory().toURI().toString()).call();
+ assertNotNull(r1);
+ addRepoToClose(r1);
+ assertNotNull(git.commit().setAll(true).setMessage("Adding submodule")
+ .call());
+
+ // Clone default repository and include submodules
+ File directory = createTempDirectory(
+ "testCloneRepositoryWithNestedSubmodules");
+ CloneCommand clone = Git.cloneRepository();
+ clone.setDirectory(directory);
+ clone.setCloneSubmodules(true);
+ clone.setURI(git.getRepository().getDirectory().toURI().toString());
+ git2 = clone.call();
+ addRepoToClose(git2.getRepository());
+ assertNotNull(git2);
+
+ // Record current FETCH_HEAD of submodules
+ try (SubmoduleWalk walk = SubmoduleWalk
+ .forIndex(git2.getRepository())) {
+ assertTrue(walk.next());
+ Repository r = walk.getRepository();
+ submodule1Head = r.resolve(Constants.FETCH_HEAD);
+
+ try (SubmoduleWalk walk2 = SubmoduleWalk.forIndex(r)) {
+ assertTrue(walk2.next());
+ submodule2Head = walk2.getRepository()
+ .resolve(Constants.FETCH_HEAD);
+ }
+ }
+
+ // Commit in submodule 1
+ JGitTestUtil.writeTrashFile(r1, "f1.txt", "test");
+ sub1Git.add().addFilepattern("f1.txt").call();
+ commit1 = sub1Git.commit().setMessage("new commit").call();
+
+ // Commit in submodule 2
+ JGitTestUtil.writeTrashFile(r2, "f2.txt", "test");
+ sub2Git.add().addFilepattern("f2.txt").call();
+ commit2 = sub2Git.commit().setMessage("new commit").call();
+ }
+
+ @Theory
+ public void shouldNotFetchSubmodulesWhenNo(boolean fetch) throws Exception {
+ FetchResult result = execute(FetchRecurseSubmodulesMode.NO, fetch);
+ assertTrue(result.submoduleResults().isEmpty());
+ assertSubmoduleFetchHeads(submodule1Head, submodule2Head);
+ }
+
+ @Theory
+ public void shouldFetchSubmodulesWhenYes(boolean fetch) throws Exception {
+ FetchResult result = execute(FetchRecurseSubmodulesMode.YES, fetch);
+ assertTrue(result.submoduleResults().containsKey("sub"));
+ FetchResult subResult = result.submoduleResults().get("sub");
+ assertTrue(subResult.submoduleResults().containsKey("sub"));
+ assertSubmoduleFetchHeads(commit1, commit2);
+ }
+
+ @Theory
+ public void shouldFetchSubmodulesWhenOnDemandAndRevisionChanged(
+ boolean fetch) throws Exception {
+ RevCommit update = updateSubmoduleRevision();
+ FetchResult result = execute(FetchRecurseSubmodulesMode.ON_DEMAND,
+ fetch);
+
+ // The first submodule should have been updated
+ assertTrue(result.submoduleResults().containsKey("sub"));
+ FetchResult subResult = result.submoduleResults().get("sub");
+
+ // The second submodule should not get updated
+ assertTrue(subResult.submoduleResults().isEmpty());
+ assertSubmoduleFetchHeads(commit1, submodule2Head);
+
+ // After fetch the parent repo's fetch head should be the commit
+ // that updated the submodule.
+ assertEquals(update,
+ git2.getRepository().resolve(Constants.FETCH_HEAD));
+ }
+
+ @Theory
+ public void shouldNotFetchSubmodulesWhenOnDemandAndRevisionNotChanged(
+ boolean fetch) throws Exception {
+ FetchResult result = execute(FetchRecurseSubmodulesMode.ON_DEMAND,
+ fetch);
+ assertTrue(result.submoduleResults().isEmpty());
+ assertSubmoduleFetchHeads(submodule1Head, submodule2Head);
+ }
+
+ @Theory
+ public void shouldNotFetchSubmodulesWhenSubmoduleConfigurationSetToNo(
+ boolean fetch) throws Exception {
+ StoredConfig config = git2.getRepository().getConfig();
+ config.setEnum(ConfigConstants.CONFIG_SUBMODULE_SECTION, PATH,
+ ConfigConstants.CONFIG_KEY_FETCH_RECURSE_SUBMODULES,
+ FetchRecurseSubmodulesMode.NO);
+ config.save();
+ updateSubmoduleRevision();
+ FetchResult result = execute(null, fetch);
+ assertTrue(result.submoduleResults().isEmpty());
+ assertSubmoduleFetchHeads(submodule1Head, submodule2Head);
+ }
+
+ @Theory
+ public void shouldFetchSubmodulesWhenSubmoduleConfigurationSetToYes(
+ boolean fetch) throws Exception {
+ StoredConfig config = git2.getRepository().getConfig();
+ config.setEnum(ConfigConstants.CONFIG_SUBMODULE_SECTION, PATH,
+ ConfigConstants.CONFIG_KEY_FETCH_RECURSE_SUBMODULES,
+ FetchRecurseSubmodulesMode.YES);
+ config.save();
+ FetchResult result = execute(null, fetch);
+ assertTrue(result.submoduleResults().containsKey("sub"));
+ FetchResult subResult = result.submoduleResults().get("sub");
+ assertTrue(subResult.submoduleResults().containsKey("sub"));
+ assertSubmoduleFetchHeads(commit1, commit2);
+ }
+
+ @Theory
+ public void shouldNotFetchSubmodulesWhenFetchConfigurationSetToNo(
+ boolean fetch) throws Exception {
+ StoredConfig config = git2.getRepository().getConfig();
+ config.setEnum(ConfigConstants.CONFIG_FETCH_SECTION, null,
+ ConfigConstants.CONFIG_KEY_RECURSE_SUBMODULES,
+ FetchRecurseSubmodulesMode.NO);
+ config.save();
+ updateSubmoduleRevision();
+ FetchResult result = execute(null, fetch);
+ assertTrue(result.submoduleResults().isEmpty());
+ assertSubmoduleFetchHeads(submodule1Head, submodule2Head);
+ }
+
+ @Theory
+ public void shouldFetchSubmodulesWhenFetchConfigurationSetToYes(
+ boolean fetch) throws Exception {
+ StoredConfig config = git2.getRepository().getConfig();
+ config.setEnum(ConfigConstants.CONFIG_FETCH_SECTION, null,
+ ConfigConstants.CONFIG_KEY_RECURSE_SUBMODULES,
+ FetchRecurseSubmodulesMode.YES);
+ config.save();
+ FetchResult result = execute(null, fetch);
+ assertTrue(result.submoduleResults().containsKey("sub"));
+ FetchResult subResult = result.submoduleResults().get("sub");
+ assertTrue(subResult.submoduleResults().containsKey("sub"));
+ assertSubmoduleFetchHeads(commit1, commit2);
+ }
+
+ private RevCommit updateSubmoduleRevision() throws Exception {
+ // Fetch the submodule in the original git and reset it to
+ // the commit that was created
+ try (SubmoduleWalk w = SubmoduleWalk.forIndex(git.getRepository())) {
+ assertTrue(w.next());
+ try (Git g = new Git(w.getRepository())) {
+ g.fetch().setRemote(REMOTE).setRefSpecs(REFSPEC).call();
+ g.reset().setMode(ResetType.HARD).setRef(commit1.name()).call();
+ }
+ }
+
+ // Submodule index Id should be same as before, but head Id should be
+ // updated to the new commit, and status should be "checked out".
+ SubmoduleStatus subStatus = git.submoduleStatus().call().get("sub");
+ assertEquals(submodule1Head, subStatus.getIndexId());
+ assertEquals(commit1, subStatus.getHeadId());
+ assertEquals(SubmoduleStatusType.REV_CHECKED_OUT, subStatus.getType());
+
+ // Add and commit the submodule status
+ git.add().addFilepattern("sub").call();
+ RevCommit update = git.commit().setMessage("update sub").call();
+
+ // Both submodule index and head should now be at the new commit, and
+ // the status should be "initialized".
+ subStatus = git.submoduleStatus().call().get("sub");
+ assertEquals(commit1, subStatus.getIndexId());
+ assertEquals(commit1, subStatus.getHeadId());
+ assertEquals(SubmoduleStatusType.INITIALIZED, subStatus.getType());
+
+ return update;
+ }
+
+ private FetchResult execute(FetchRecurseSubmodulesMode mode, boolean fetch)
+ throws Exception {
+ FetchResult result;
+
+ if (fetch) {
+ result = git2.fetch().setRemote(REMOTE).setRefSpecs(REFSPEC)
+ .setRecurseSubmodules(mode).call();
+ } else {
+ // For the purposes of this test we don't need to care about the
+ // pull result, or the result of pull with merge. We are only
+ // interested in checking whether or not the submodules were updated
+ // as expected. Setting to rebase makes it easier to assert about
+ // the state of the parent repository head, i.e. we know it should
+ // be at the submodule update commit, and don't need to consider a
+ // merge commit created by the pull.
+ result = git2.pull().setRemote(REMOTE).setRebase(true)
+ .setRecurseSubmodules(mode).call().getFetchResult();
+ }
+ assertNotNull(result);
+ return result;
+ }
+
+ private void assertSubmoduleFetchHeads(ObjectId expectedHead1,
+ ObjectId expectedHead2) throws Exception {
+ try (SubmoduleWalk walk = SubmoduleWalk
+ .forIndex(git2.getRepository())) {
+ assertTrue(walk.next());
+ Repository r = walk.getRepository();
+ ObjectId newHead1 = r.resolve(Constants.FETCH_HEAD);
+ ObjectId newHead2;
+ try (SubmoduleWalk walk2 = SubmoduleWalk.forIndex(r)) {
+ assertTrue(walk2.next());
+ newHead2 = walk2.getRepository().resolve(Constants.FETCH_HEAD);
+ }
+
+ assertEquals(expectedHead1, newHead1);
+ assertEquals(expectedHead2, newHead2);
+ }
+ }
+}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/FetchCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/FetchCommandTest.java
index 56a1f38013..a36f6c551a 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/FetchCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/FetchCommandTest.java
@@ -45,12 +45,8 @@ package org.eclipse.jgit.api;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import java.io.IOException;
-import java.net.URISyntaxException;
import java.util.Collection;
-import org.eclipse.jgit.api.errors.GitAPIException;
-import org.eclipse.jgit.api.errors.JGitInternalException;
import org.eclipse.jgit.junit.RepositoryTestCase;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
@@ -74,7 +70,7 @@ public class FetchCommandTest extends RepositoryTestCase {
private Git remoteGit;
@Before
- public void setupRemoteRepository() throws IOException, URISyntaxException {
+ public void setupRemoteRepository() throws Exception {
git = new Git(db);
// create other repository
@@ -91,8 +87,7 @@ public class FetchCommandTest extends RepositoryTestCase {
}
@Test
- public void testFetch() throws JGitInternalException, IOException,
- GitAPIException {
+ public void testFetch() throws Exception {
// create some refs via commits and tag
RevCommit commit = remoteGit.commit().setMessage("initial commit").call();
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/GitConstructionTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/GitConstructionTest.java
index 3bff8f2ff6..a4e5574342 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/GitConstructionTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/GitConstructionTest.java
@@ -55,7 +55,6 @@ import org.eclipse.jgit.errors.RepositoryNotFoundException;
import org.eclipse.jgit.junit.RepositoryTestCase;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.util.FileUtils;
-import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -80,14 +79,6 @@ public class GitConstructionTest extends RepositoryTestCase {
addRepoToClose(bareRepo);
}
- @Override
- @After
- public void tearDown() throws Exception {
- db.close();
- bareRepo.close();
- super.tearDown();
- }
-
@Test
public void testWrap() throws JGitInternalException, GitAPIException {
Git git = Git.wrap(db);
@@ -141,7 +132,6 @@ public class GitConstructionTest extends RepositoryTestCase {
public void testClose() throws IOException, JGitInternalException,
GitAPIException {
File workTree = db.getWorkTree();
- db.close();
Git git = Git.open(workTree);
git.gc().setExpire(null).call();
git.checkout().setName(git.getRepository().resolve("HEAD^").getName())
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LogCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LogCommandTest.java
index 1310625a9b..38178bfd0e 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LogCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LogCommandTest.java
@@ -62,7 +62,7 @@ public class LogCommandTest extends RepositoryTestCase {
@Test
public void logAllCommits() throws Exception {
- List<RevCommit> commits = new ArrayList<RevCommit>();
+ List<RevCommit> commits = new ArrayList<>();
Git git = Git.wrap(db);
writeTrashFile("Test.txt", "Hello world");
@@ -94,7 +94,7 @@ public class LogCommandTest extends RepositoryTestCase {
@Test
public void logAllCommitsWithTag() throws Exception {
- List<RevCommit> commits = new ArrayList<RevCommit>();
+ List<RevCommit> commits = new ArrayList<>();
Git git = Git.wrap(db);
writeTrashFile("Test.txt", "Hello world");
@@ -123,7 +123,7 @@ public class LogCommandTest extends RepositoryTestCase {
}
private List<RevCommit> createCommits(Git git) throws Exception {
- List<RevCommit> commits = new ArrayList<RevCommit>();
+ List<RevCommit> commits = new ArrayList<>();
writeTrashFile("Test.txt", "Hello world");
git.add().addFilepattern("Test.txt").call();
commits.add(git.commit().setMessage("commit#1").call());
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LsRemoteCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LsRemoteCommandTest.java
index a853d6ab8f..c9f77ea8a7 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LsRemoteCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LsRemoteCommandTest.java
@@ -58,6 +58,7 @@ public class LsRemoteCommandTest extends RepositoryTestCase {
private Git git;
+ @Override
public void setUp() throws Exception {
super.setUp();
git = new Git(db);
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java
index cb3dbf1bc2..4b23349fa6 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java
@@ -1556,7 +1556,7 @@ public class MergeCommandTest extends RepositoryTestCase {
@Test
public void testRecursiveMergeWithConflict() throws Exception {
- TestRepository<Repository> db_t = new TestRepository<Repository>(db);
+ TestRepository<Repository> db_t = new TestRepository<>(db);
BranchBuilder master = db_t.branch("master");
RevCommit m0 = master.commit().add("f", "1\n2\n3\n4\n5\n6\n7\n8\n9\n")
.message("m0").create();
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/NameRevCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/NameRevCommandTest.java
index bd62200fce..138b7afcd6 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/NameRevCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/NameRevCommandTest.java
@@ -64,7 +64,7 @@ public class NameRevCommandTest extends RepositoryTestCase {
@Before
public void setUp() throws Exception {
super.setUp();
- tr = new TestRepository<Repository>(db);
+ tr = new TestRepository<>(db);
git = new Git(db);
}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PullCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PullCommandTest.java
index a526fdaa7e..823516b99b 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PullCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PullCommandTest.java
@@ -346,6 +346,7 @@ public class PullCommandTest extends RepositoryTestCase {
/** global rebase config should be respected */
public void testPullWithRebasePreserve1Config() throws Exception {
Callable<PullResult> setup = new Callable<PullResult>() {
+ @Override
public PullResult call() throws Exception {
StoredConfig config = dbTarget.getConfig();
config.setString("pull", null, "rebase", "preserve");
@@ -360,6 +361,7 @@ public class PullCommandTest extends RepositoryTestCase {
/** the branch-local config should win over the global config */
public void testPullWithRebasePreserveConfig2() throws Exception {
Callable<PullResult> setup = new Callable<PullResult>() {
+ @Override
public PullResult call() throws Exception {
StoredConfig config = dbTarget.getConfig();
config.setString("pull", null, "rebase", "false");
@@ -375,6 +377,7 @@ public class PullCommandTest extends RepositoryTestCase {
/** the branch-local config should be respected */
public void testPullWithRebasePreserveConfig3() throws Exception {
Callable<PullResult> setup = new Callable<PullResult>() {
+ @Override
public PullResult call() throws Exception {
StoredConfig config = dbTarget.getConfig();
config.setString("branch", "master", "rebase", "preserve");
@@ -389,6 +392,7 @@ public class PullCommandTest extends RepositoryTestCase {
/** global rebase config should be respected */
public void testPullWithRebaseConfig1() throws Exception {
Callable<PullResult> setup = new Callable<PullResult>() {
+ @Override
public PullResult call() throws Exception {
StoredConfig config = dbTarget.getConfig();
config.setString("pull", null, "rebase", "true");
@@ -403,6 +407,7 @@ public class PullCommandTest extends RepositoryTestCase {
/** the branch-local config should win over the global config */
public void testPullWithRebaseConfig2() throws Exception {
Callable<PullResult> setup = new Callable<PullResult>() {
+ @Override
public PullResult call() throws Exception {
StoredConfig config = dbTarget.getConfig();
config.setString("pull", null, "rebase", "preserve");
@@ -418,6 +423,7 @@ public class PullCommandTest extends RepositoryTestCase {
/** the branch-local config should be respected */
public void testPullWithRebaseConfig3() throws Exception {
Callable<PullResult> setup = new Callable<PullResult>() {
+ @Override
public PullResult call() throws Exception {
StoredConfig config = dbTarget.getConfig();
config.setString("branch", "master", "rebase", "true");
@@ -432,6 +438,7 @@ public class PullCommandTest extends RepositoryTestCase {
/** without config it should merge */
public void testPullWithoutConfig() throws Exception {
Callable<PullResult> setup = new Callable<PullResult>() {
+ @Override
public PullResult call() throws Exception {
return target.pull().call();
}
@@ -443,6 +450,7 @@ public class PullCommandTest extends RepositoryTestCase {
/** the branch local config should win over the global config */
public void testPullWithMergeConfig() throws Exception {
Callable<PullResult> setup = new Callable<PullResult>() {
+ @Override
public PullResult call() throws Exception {
StoredConfig config = dbTarget.getConfig();
config.setString("pull", null, "rebase", "true");
@@ -458,6 +466,7 @@ public class PullCommandTest extends RepositoryTestCase {
/** the branch local config should win over the global config */
public void testPullWithMergeConfig2() throws Exception {
Callable<PullResult> setup = new Callable<PullResult>() {
+ @Override
public PullResult call() throws Exception {
StoredConfig config = dbTarget.getConfig();
config.setString("pull", null, "rebase", "false");
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PushCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PushCommandTest.java
index 2a325405e8..8c613ec488 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PushCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PushCommandTest.java
@@ -66,8 +66,10 @@ import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.StoredConfig;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.transport.PushResult;
+import org.eclipse.jgit.transport.RefLeaseSpec;
import org.eclipse.jgit.transport.RefSpec;
import org.eclipse.jgit.transport.RemoteConfig;
+import org.eclipse.jgit.transport.RemoteRefUpdate;
import org.eclipse.jgit.transport.TrackingRefUpdate;
import org.eclipse.jgit.transport.URIish;
import org.eclipse.jgit.util.FS;
@@ -379,4 +381,56 @@ public class PushCommandTest extends RepositoryTestCase {
db2.resolve(commit3.getId().getName() + "^{commit}"));
}
}
+
+ @Test
+ public void testPushWithLease() throws JGitInternalException, IOException,
+ GitAPIException, URISyntaxException {
+
+ // create other repository
+ Repository db2 = createWorkRepository();
+
+ // setup the first repository
+ final StoredConfig config = db.getConfig();
+ RemoteConfig remoteConfig = new RemoteConfig(config, "test");
+ URIish uri = new URIish(db2.getDirectory().toURI().toURL());
+ remoteConfig.addURI(uri);
+ remoteConfig.update(config);
+ config.save();
+
+ try (Git git1 = new Git(db)) {
+ // create one commit and push it
+ RevCommit commit = git1.commit().setMessage("initial commit").call();
+ git1.branchCreate().setName("initial").call();
+
+ RefSpec spec = new RefSpec("refs/heads/master:refs/heads/x");
+ git1.push().setRemote("test").setRefSpecs(spec)
+ .call();
+
+ assertEquals(commit.getId(),
+ db2.resolve(commit.getId().getName() + "^{commit}"));
+ //now try to force-push a new commit, with a good lease
+
+ git1.commit().setMessage("second commit").call();
+ Iterable<PushResult> results =
+ git1.push().setRemote("test").setRefSpecs(spec)
+ .setRefLeaseSpecs(new RefLeaseSpec("refs/heads/x", "initial"))
+ .call();
+ for (PushResult result : results) {
+ RemoteRefUpdate update = result.getRemoteUpdate("refs/heads/x");
+ assertEquals(update.getStatus(), RemoteRefUpdate.Status.OK);
+ }
+
+ git1.commit().setMessage("third commit").call();
+ //now try to force-push a new commit, with a bad lease
+
+ results =
+ git1.push().setRemote("test").setRefSpecs(spec)
+ .setRefLeaseSpecs(new RefLeaseSpec("refs/heads/x", "initial"))
+ .call();
+ for (PushResult result : results) {
+ RemoteRefUpdate update = result.getRemoteUpdate("refs/heads/x");
+ assertEquals(update.getStatus(), RemoteRefUpdate.Status.REJECTED_REMOTE_CHANGED);
+ }
+ }
+ }
}
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 24cb522a00..0cc0816c16 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
@@ -2269,11 +2269,13 @@ public class RebaseCommandTest extends RepositoryTestCase {
RebaseResult res = git.rebase().setUpstream("HEAD~2")
.runInteractively(new InteractiveHandler() {
+ @Override
public void prepareSteps(List<RebaseTodoLine> steps) {
steps.add(0, new RebaseTodoLine(
"# Comment that should not be processed"));
}
+ @Override
public String modifyCommitMessage(String commit) {
fail("modifyCommitMessage() was not expected to be called");
return commit;
@@ -2284,6 +2286,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
RebaseResult res2 = git.rebase().setUpstream("HEAD~2")
.runInteractively(new InteractiveHandler() {
+ @Override
public void prepareSteps(List<RebaseTodoLine> steps) {
try {
// delete RevCommit c4
@@ -2293,6 +2296,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
}
}
+ @Override
public String modifyCommitMessage(String commit) {
fail("modifyCommitMessage() was not expected to be called");
return commit;
@@ -2514,6 +2518,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
RebaseResult res = git.rebase().setUpstream("HEAD~2")
.runInteractively(new InteractiveHandler() {
+ @Override
public void prepareSteps(List<RebaseTodoLine> steps) {
try {
steps.get(0).setAction(Action.REWORD);
@@ -2522,6 +2527,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
}
}
+ @Override
public String modifyCommitMessage(String commit) {
return "rewritten commit message";
}
@@ -2560,6 +2566,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
RebaseResult res = git.rebase().setUpstream("HEAD~2")
.runInteractively(new InteractiveHandler() {
+ @Override
public void prepareSteps(List<RebaseTodoLine> steps) {
try {
steps.get(0).setAction(Action.EDIT);
@@ -2568,6 +2575,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
}
}
+ @Override
public String modifyCommitMessage(String commit) {
return ""; // not used
}
@@ -2624,6 +2632,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
git.rebase().setUpstream("HEAD~3")
.runInteractively(new InteractiveHandler() {
+ @Override
public void prepareSteps(List<RebaseTodoLine> steps) {
try {
steps.get(1).setAction(Action.SQUASH);
@@ -2632,6 +2641,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
}
}
+ @Override
public String modifyCommitMessage(String commit) {
final File messageSquashFile = new File(db
.getDirectory(), "rebase-merge/message-squash");
@@ -2704,6 +2714,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
git.rebase().setUpstream("HEAD~4")
.runInteractively(new InteractiveHandler() {
+ @Override
public void prepareSteps(List<RebaseTodoLine> steps) {
try {
steps.get(1).setAction(Action.SQUASH);
@@ -2713,6 +2724,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
}
}
+ @Override
public String modifyCommitMessage(String commit) {
final File messageSquashFile = new File(db.getDirectory(),
"rebase-merge/message-squash");
@@ -2786,6 +2798,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
git.rebase().setUpstream("HEAD~4")
.runInteractively(new InteractiveHandler() {
+ @Override
public void prepareSteps(List<RebaseTodoLine> steps) {
try {
steps.get(1).setAction(Action.FIXUP);
@@ -2795,6 +2808,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
}
}
+ @Override
public String modifyCommitMessage(String commit) {
final File messageSquashFile = new File(db
.getDirectory(), "rebase-merge/message-squash");
@@ -2861,6 +2875,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
git.rebase().setUpstream("HEAD~3")
.runInteractively(new InteractiveHandler() {
+ @Override
public void prepareSteps(List<RebaseTodoLine> steps) {
try {
steps.get(1).setAction(Action.FIXUP);
@@ -2869,6 +2884,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
}
}
+ @Override
public String modifyCommitMessage(String commit) {
fail("No callback to modify commit message expected for single fixup");
return commit;
@@ -2910,6 +2926,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
git.rebase().setUpstream("HEAD~2")
.runInteractively(new InteractiveHandler() {
+ @Override
public void prepareSteps(List<RebaseTodoLine> steps) {
try {
steps.get(1).setAction(Action.FIXUP);
@@ -2918,6 +2935,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
}
}
+ @Override
public String modifyCommitMessage(String commit) {
fail("No callback to modify commit message expected for single fixup");
return commit;
@@ -2950,6 +2968,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
git.rebase().setUpstream("HEAD~1")
.runInteractively(new InteractiveHandler() {
+ @Override
public void prepareSteps(List<RebaseTodoLine> steps) {
try {
steps.get(0).setAction(Action.FIXUP);
@@ -2958,6 +2977,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
}
}
+ @Override
public String modifyCommitMessage(String commit) {
return commit;
}
@@ -2982,6 +3002,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
git.rebase().setUpstream("HEAD~1")
.runInteractively(new InteractiveHandler() {
+ @Override
public void prepareSteps(List<RebaseTodoLine> steps) {
try {
steps.get(0).setAction(Action.SQUASH);
@@ -2990,6 +3011,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
}
}
+ @Override
public String modifyCommitMessage(String commit) {
return commit;
}
@@ -3013,6 +3035,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
git.rebase().setUpstream("HEAD~1")
.runInteractively(new InteractiveHandler() {
+ @Override
public void prepareSteps(List<RebaseTodoLine> steps) {
try {
steps.get(0).setAction(Action.EDIT);
@@ -3021,6 +3044,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
}
}
+ @Override
public String modifyCommitMessage(String commit) {
return commit;
}
@@ -3055,6 +3079,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
RebaseResult result = git.rebase().setUpstream("HEAD~2")
.runInteractively(new InteractiveHandler() {
+ @Override
public void prepareSteps(List<RebaseTodoLine> steps) {
steps.remove(0);
try {
@@ -3064,6 +3089,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
}
}
+ @Override
public String modifyCommitMessage(String commit) {
return commit;
}
@@ -3097,6 +3123,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
RebaseResult result = git.rebase().setUpstream("HEAD~2")
.runInteractively(new InteractiveHandler() {
+ @Override
public void prepareSteps(List<RebaseTodoLine> steps) {
steps.remove(0);
try {
@@ -3106,6 +3133,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
}
}
+ @Override
public String modifyCommitMessage(String commit) {
return "rewritten commit message";
}
@@ -3114,6 +3142,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
git.add().addFilepattern(FILE1).call();
result = git.rebase().runInteractively(new InteractiveHandler() {
+ @Override
public void prepareSteps(List<RebaseTodoLine> steps) {
steps.remove(0);
try {
@@ -3123,6 +3152,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
}
}
+ @Override
public String modifyCommitMessage(String commit) {
return "rewritten commit message";
}
@@ -3160,6 +3190,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
RebaseResult result = git.rebase().setUpstream("HEAD~3")
.runInteractively(new InteractiveHandler() {
+ @Override
public void prepareSteps(List<RebaseTodoLine> steps) {
try {
steps.get(0).setAction(Action.PICK);
@@ -3170,6 +3201,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
}
}
+ @Override
public String modifyCommitMessage(String commit) {
return "squashed message";
}
@@ -3178,6 +3210,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
git.add().addFilepattern(FILE1).call();
result = git.rebase().runInteractively(new InteractiveHandler() {
+ @Override
public void prepareSteps(List<RebaseTodoLine> steps) {
try {
steps.get(0).setAction(Action.PICK);
@@ -3188,6 +3221,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
}
}
+ @Override
public String modifyCommitMessage(String commit) {
return "squashed message";
}
@@ -3226,6 +3260,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
RebaseResult result = git.rebase().setUpstream("HEAD~3")
.runInteractively(new InteractiveHandler() {
+ @Override
public void prepareSteps(List<RebaseTodoLine> steps) {
try {
steps.get(0).setAction(Action.PICK);
@@ -3236,6 +3271,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
}
}
+ @Override
public String modifyCommitMessage(String commit) {
return commit;
}
@@ -3244,6 +3280,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
git.add().addFilepattern(FILE1).call();
result = git.rebase().runInteractively(new InteractiveHandler() {
+ @Override
public void prepareSteps(List<RebaseTodoLine> steps) {
try {
steps.get(0).setAction(Action.PICK);
@@ -3254,6 +3291,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
}
}
+ @Override
public String modifyCommitMessage(String commit) {
return "commit";
}
@@ -3297,6 +3335,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
RebaseResult result = git.rebase().setUpstream("HEAD~2")
.runInteractively(new InteractiveHandler() {
+ @Override
public void prepareSteps(List<RebaseTodoLine> steps) {
try {
steps.get(0).setAction(Action.EDIT);
@@ -3306,6 +3345,7 @@ public class RebaseCommandTest extends RepositoryTestCase {
}
}
+ @Override
public String modifyCommitMessage(String commit) {
return commit;
}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RenameBranchCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RenameBranchCommandTest.java
index 4c09a82572..5c437ac5a1 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RenameBranchCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RenameBranchCommandTest.java
@@ -69,6 +69,7 @@ public class RenameBranchCommandTest extends RepositoryTestCase {
private Git git;
+ @Override
@Before
public void setUp() throws Exception {
super.setUp();
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashApplyCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashApplyCommandTest.java
index ce235a722f..f2e4d5b3b3 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashApplyCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashApplyCommandTest.java
@@ -77,6 +77,7 @@ public class StashApplyCommandTest extends RepositoryTestCase {
private File committedFile;
+ @Override
@Before
public void setUp() throws Exception {
super.setUp();
@@ -736,4 +737,21 @@ public class StashApplyCommandTest extends RepositoryTestCase {
}
assertEquals("working-directory", read(path));
}
+
+ @Test
+ public void untrackedAndTrackedChanges() throws Exception {
+ writeTrashFile(PATH, "changed");
+ String path = "untracked.txt";
+ writeTrashFile(path, "untracked");
+ git.stashCreate().setIncludeUntracked(true).call();
+ assertTrue(PATH + " should exist", check(PATH));
+ assertEquals(PATH + " should have been reset", "content", read(PATH));
+ assertFalse(path + " should not exist", check(path));
+ git.stashApply().setStashRef("stash@{0}").call();
+ assertTrue(PATH + " should exist", check(PATH));
+ assertEquals(PATH + " should have new content", "changed", read(PATH));
+ assertTrue(path + " should exist", check(path));
+ assertEquals(path + " should have new content", "untracked",
+ read(path));
+ }
}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashCreateCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashCreateCommandTest.java
index ae8551e641..b9f9f5b499 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashCreateCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashCreateCommandTest.java
@@ -82,6 +82,7 @@ public class StashCreateCommandTest extends RepositoryTestCase {
private File untrackedFile;
+ @Override
@Before
public void setUp() throws Exception {
super.setUp();
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 859277e93f..5d5be5ddfd 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
@@ -73,6 +73,7 @@ public class StashDropCommandTest extends RepositoryTestCase {
private File committedFile;
+ @Override
@Before
public void setUp() throws Exception {
super.setUp();
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 b044c01db6..1d9cd78140 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
@@ -204,7 +204,7 @@ public class TreeWalkAttributeTest extends RepositoryTestCase {
@Test
public void testIndexOnly() throws IOException, NoFilepatternException,
GitAPIException {
- List<File> attrFiles = new ArrayList<File>();
+ List<File> attrFiles = new ArrayList<>();
attrFiles.add(writeGlobalAttributeFile("globalAttributesFile",
"*.txt -custom2"));
attrFiles.add(writeAttributesFile(".git/info/attributes",
@@ -813,7 +813,7 @@ public class TreeWalkAttributeTest extends RepositoryTestCase {
}
private static Set<Attribute> asSet(Collection<Attribute> attributes) {
- Set<Attribute> ret = new HashSet<Attribute>();
+ Set<Attribute> ret = new HashSet<>();
for (Attribute a : attributes) {
ret.add(a);
}
@@ -853,7 +853,7 @@ public class TreeWalkAttributeTest extends RepositoryTestCase {
}
static Set<Attribute> asSet(Attribute... attrs) {
- HashSet<Attribute> result = new HashSet<Attribute>();
+ HashSet<Attribute> result = new HashSet<>();
for (Attribute attr : attrs)
result.add(attr);
return result;
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffEntryTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffEntryTest.java
index 443c956b73..73c230ac68 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffEntryTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffEntryTest.java
@@ -395,6 +395,7 @@ public class DiffEntryTest extends RepositoryTestCase {
assertTrue(walk.next());
editor.add(new PathEdit("a.txt") {
+ @Override
public void apply(DirCacheEntry ent) {
ent.setFileMode(FileMode.EXECUTABLE_FILE);
ent.setObjectId(walk.getObjectId(0));
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java
index b4234dcba3..fabf03440a 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java
@@ -89,7 +89,7 @@ public class DiffFormatterTest extends RepositoryTestCase {
@Before
public void setUp() throws Exception {
super.setUp();
- testDb = new TestRepository<Repository>(db);
+ testDb = new TestRepository<>(db);
df = new DiffFormatter(DisabledOutputStream.INSTANCE);
df.setRepository(db);
df.setAbbreviationLength(8);
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RenameDetectorTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RenameDetectorTest.java
index 4315be9e49..64eb1c9ba5 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RenameDetectorTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RenameDetectorTest.java
@@ -75,7 +75,7 @@ public class RenameDetectorTest extends RepositoryTestCase {
@Before
public void setUp() throws Exception {
super.setUp();
- testDb = new TestRepository<Repository>(db);
+ testDb = new TestRepository<>(db);
rd = new RenameDetector(db);
}
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 5408f761dc..d12f302dae 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
@@ -211,6 +211,7 @@ public class DirCacheBuilderTest extends RepositoryTestCase {
DirCache dc = db.lockDirCache();
IndexChangedListener listener = new IndexChangedListener() {
+ @Override
public void onIndexChanged(IndexChangedEvent event) {
throw new ReceivedEventMarkerException();
}
@@ -238,6 +239,7 @@ public class DirCacheBuilderTest extends RepositoryTestCase {
dc = db.lockDirCache();
listener = new IndexChangedListener() {
+ @Override
public void onIndexChanged(IndexChangedEvent event) {
throw new ReceivedEventMarkerException();
}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheCGitCompatabilityTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheCGitCompatabilityTest.java
index 3e780467bf..92ce4e178b 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheCGitCompatabilityTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheCGitCompatabilityTest.java
@@ -178,7 +178,7 @@ public class DirCacheCGitCompatabilityTest extends LocalDiskRepositoryTestCase {
.getObjectId());
assertEquals(cList.size(), jTree.getEntrySpan());
- final ArrayList<CGitLsTreeRecord> subtrees = new ArrayList<CGitLsTreeRecord>();
+ final ArrayList<CGitLsTreeRecord> subtrees = new ArrayList<>();
for (final CGitLsTreeRecord r : cTree.values()) {
if (FileMode.TREE.equals(r.mode))
subtrees.add(r);
@@ -233,7 +233,7 @@ public class DirCacheCGitCompatabilityTest extends LocalDiskRepositoryTestCase {
}
private static Map<String, CGitIndexRecord> readLsFiles() throws Exception {
- final LinkedHashMap<String, CGitIndexRecord> r = new LinkedHashMap<String, CGitIndexRecord>();
+ final LinkedHashMap<String, CGitIndexRecord> r = new LinkedHashMap<>();
final BufferedReader br = new BufferedReader(new InputStreamReader(
new FileInputStream(pathOf("gitgit.lsfiles")), "UTF-8"));
try {
@@ -249,7 +249,7 @@ public class DirCacheCGitCompatabilityTest extends LocalDiskRepositoryTestCase {
}
private static Map<String, CGitLsTreeRecord> readLsTree() throws Exception {
- final LinkedHashMap<String, CGitLsTreeRecord> r = new LinkedHashMap<String, CGitLsTreeRecord>();
+ final LinkedHashMap<String, CGitLsTreeRecord> r = new LinkedHashMap<>();
final BufferedReader br = new BufferedReader(new InputStreamReader(
new FileInputStream(pathOf("gitgit.lstree")), "UTF-8"));
try {
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCachePathEditTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCachePathEditTest.java
index c85e156352..20897a8ba5 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCachePathEditTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCachePathEditTest.java
@@ -72,7 +72,7 @@ public class DirCachePathEditTest {
}
private static final class RecordingEdit extends PathEdit {
- final List<DirCacheEntry> entries = new ArrayList<DirCacheEntry>();
+ final List<DirCacheEntry> entries = new ArrayList<>();
public RecordingEdit(String entryPath) {
super(entryPath);
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/events/ConfigChangeEventTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/events/ConfigChangeEventTest.java
index 3c1f231db3..3624100671 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/events/ConfigChangeEventTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/events/ConfigChangeEventTest.java
@@ -56,6 +56,7 @@ public class ConfigChangeEventTest extends RepositoryTestCase {
final ConfigChangedEvent[] events = new ConfigChangedEvent[1];
db.getListenerList().addConfigChangedListener(
new ConfigChangedListener() {
+ @Override
public void onConfigChanged(ConfigChangedEvent event) {
events[0] = event;
}
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 b1138f04cd..c9673a6882 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
@@ -44,12 +44,16 @@ package org.eclipse.jgit.gitrepo;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.net.URI;
import java.util.HashSet;
import java.util.Set;
import org.junit.Test;
+import org.xml.sax.SAXException;
public class ManifestParserTest {
@@ -57,7 +61,7 @@ public class ManifestParserTest {
public void testManifestParser() throws Exception {
String baseUrl = "https://git.google.com/";
StringBuilder xmlContent = new StringBuilder();
- Set<String> results = new HashSet<String>();
+ Set<String> results = new HashSet<>();
xmlContent.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
.append("<manifest>")
.append("<remote name=\"remote1\" fetch=\".\" />")
@@ -110,4 +114,49 @@ public class ManifestParserTest {
"Filtered projects shouldn't contain any unexpected results",
results.isEmpty());
}
+
+ @Test
+ public void testManifestParserWithMissingFetchOnRemote() throws Exception {
+ String baseUrl = "https://git.google.com/";
+ StringBuilder xmlContent = new StringBuilder();
+ xmlContent.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
+ .append("<manifest>")
+ .append("<remote name=\"remote1\" />")
+ .append("<default revision=\"master\" remote=\"remote1\" />")
+ .append("<project path=\"foo\" name=\"").append("foo")
+ .append("\" groups=\"a,test\" />")
+ .append("<project path=\"bar\" name=\"").append("bar")
+ .append("\" groups=\"notdefault\" />")
+ .append("<project path=\"foo/a\" name=\"").append("a")
+ .append("\" groups=\"a\" />")
+ .append("<project path=\"b\" name=\"").append("b")
+ .append("\" groups=\"b\" />").append("</manifest>");
+
+ ManifestParser parser = new ManifestParser(null, null, "master",
+ baseUrl, null, null);
+ try {
+ parser.read(new ByteArrayInputStream(
+ xmlContent.toString().getBytes(UTF_8)));
+ fail("ManifestParser did not throw exception for missing fetch");
+ } catch (IOException e) {
+ assertTrue(e.getCause() instanceof SAXException);
+ assertTrue(e.getCause().getMessage()
+ .contains("is missing fetch attribute"));
+ }
+ }
+
+ void testNormalize(String in, String want) {
+ URI got = ManifestParser.normalizeEmptyPath(URI.create(in));
+ if (!got.toString().equals(want)) {
+ fail(String.format("normalize(%s) = %s want %s", in, got, want));
+ }
+ }
+
+ @Test
+ public void testNormalizeEmptyPath() {
+ testNormalize("http://a.b", "http://a.b/");
+ testNormalize("http://a.b/", "http://a.b/");
+ testNormalize("", "");
+ testNormalize("a/b", "a/b");
+ }
}
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 ccd15d038d..9cf4569d66 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
@@ -48,15 +48,28 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileReader;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
+import java.util.Map;
import org.eclipse.jgit.api.Git;
+import org.eclipse.jgit.api.errors.GitAPIException;
+import org.eclipse.jgit.api.errors.InvalidRemoteException;
+import org.eclipse.jgit.api.errors.RefNotFoundException;
import org.eclipse.jgit.junit.JGitTestUtil;
import org.eclipse.jgit.junit.RepositoryTestCase;
+import org.eclipse.jgit.lib.BlobBasedConfig;
+import org.eclipse.jgit.lib.Config;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
+import org.eclipse.jgit.lib.ObjectReader;
+import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.storage.file.FileBasedConfig;
import org.eclipse.jgit.util.FS;
import org.junit.Test;
@@ -79,6 +92,7 @@ public class RepoCommandTest extends RepositoryTestCase {
private ObjectId oldCommitId;
+ @Override
public void setUp() throws Exception {
super.setUp();
@@ -123,6 +137,108 @@ public class RepoCommandTest extends RepositoryTestCase {
resolveRelativeUris();
}
+ class IndexedRepos implements RepoCommand.RemoteReader {
+ Map<String, Repository> uriRepoMap;
+ IndexedRepos() {
+ uriRepoMap = new HashMap<>();
+ }
+
+ void put(String u, Repository r) {
+ uriRepoMap.put(u, r);
+ }
+
+ @Override
+ public ObjectId sha1(String uri, String refname) throws GitAPIException {
+ if (!uriRepoMap.containsKey(uri)) {
+ return null;
+ }
+
+ Repository r = uriRepoMap.get(uri);
+ try {
+ Ref ref = r.findRef(refname);
+ if (ref == null) return null;
+
+ ref = r.peel(ref);
+ ObjectId id = ref.getObjectId();
+ return id;
+ } catch (IOException e) {
+ throw new InvalidRemoteException("", e);
+ }
+ }
+
+ @Override
+ public byte[] readFile(String uri, String refName, String path)
+ throws GitAPIException, IOException {
+ Repository repo = uriRepoMap.get(uri);
+
+ String idStr = refName + ":" + path;
+ ObjectId id = repo.resolve(idStr);
+ if (id == null) {
+ throw new RefNotFoundException(
+ String.format("repo %s does not have %s", repo.toString(), idStr));
+ }
+ try (ObjectReader reader = repo.newObjectReader()) {
+ return reader.open(id).getCachedBytes(Integer.MAX_VALUE);
+ }
+ }
+ }
+
+ @Test
+ public void absoluteRemoteURL() throws Exception {
+ Repository child =
+ Git.cloneRepository().setURI(groupADb.getDirectory().toURI().toString())
+ .setDirectory(createUniqueTestGitDir(true))
+ .setBare(true).call().getRepository();
+ Repository dest = Git.cloneRepository()
+ .setURI(db.getDirectory().toURI().toString()).setDirectory(createUniqueTestGitDir(true))
+ .setBare(true).call().getRepository();
+ String abs = "https://chromium.googlesource.com";
+ String repoUrl = "https://chromium.googlesource.com/chromium/src";
+ boolean fetchSlash = false;
+ boolean baseSlash = false;
+ do {
+ do {
+ String fetchUrl = fetchSlash ? abs + "/" : abs;
+ String baseUrl = baseSlash ? abs + "/" : abs;
+
+ StringBuilder xmlContent = new StringBuilder();
+ xmlContent.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
+ .append("<manifest>")
+ .append("<remote name=\"origin\" fetch=\"" + fetchUrl + "\" />")
+ .append("<default revision=\"master\" remote=\"origin\" />")
+ .append("<project path=\"src\" name=\"chromium/src\" />")
+ .append("</manifest>");
+ RepoCommand cmd = new RepoCommand(dest);
+
+ IndexedRepos repos = new IndexedRepos();
+ repos.put(repoUrl, child);
+
+ RevCommit commit = cmd
+ .setInputStream(new ByteArrayInputStream(xmlContent.toString().getBytes(StandardCharsets.UTF_8)))
+ .setRemoteReader(repos)
+ .setURI(baseUrl)
+ .setRecordRemoteBranch(true)
+ .setRecordSubmoduleLabels(true)
+ .call();
+
+ String idStr = commit.getId().name() + ":" + ".gitmodules";
+ ObjectId modId = dest.resolve(idStr);
+
+ try (ObjectReader reader = dest.newObjectReader()) {
+ byte[] bytes = reader.open(modId).getCachedBytes(Integer.MAX_VALUE);
+ Config base = new Config();
+ BlobBasedConfig cfg = new BlobBasedConfig(base, bytes);
+ String subUrl = cfg.getString("submodule", "src", "url");
+ assertEquals("https://chromium.googlesource.com/chromium/src", subUrl);
+ }
+ fetchSlash = !fetchSlash;
+ } while (fetchSlash);
+ baseSlash = !baseSlash;
+ } while (baseSlash);
+ child.close();
+ dest.close();
+ }
+
@Test
public void testAddRepoManifest() throws Exception {
StringBuilder xmlContent = new StringBuilder();
@@ -248,46 +364,42 @@ public class RepoCommandTest extends RepositoryTestCase {
@Test
public void testBareRepo() throws Exception {
- try (
- 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=\"foo\" name=\"").append(defaultUri)
- .append("\" />").append("</manifest>");
- JGitTestUtil.writeTrashFile(tempDb, "manifest.xml",
- xmlContent.toString());
- RepoCommand command = new RepoCommand(remoteDb);
- command.setPath(
- tempDb.getWorkTree().getAbsolutePath() + "/manifest.xml")
- .setURI(rootUri).call();
- // Clone it
- File directory = createTempDirectory("testBareRepo");
- 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());
- // The first line of .gitmodules file should be expected
- BufferedReader reader = new BufferedReader(new FileReader(
- gitmodules));
- String content = reader.readLine();
- reader.close();
- assertEquals(
- "The first line of .gitmodules file should be as expected",
- "[submodule \"foo\"]", content);
- // The gitlink should be the same as remote head sha1
- String gitlink = localDb.resolve(Constants.HEAD + ":foo").name();
- localDb.close();
- String remote = defaultDb.resolve(Constants.HEAD).name();
- assertEquals("The gitlink should be the same as remote head",
- remote, gitlink);
- }
+ 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=\"foo\" name=\"").append(defaultUri)
+ .append("\" />").append("</manifest>");
+ JGitTestUtil.writeTrashFile(tempDb, "manifest.xml",
+ xmlContent.toString());
+ RepoCommand command = new RepoCommand(remoteDb);
+ command.setPath(
+ tempDb.getWorkTree().getAbsolutePath() + "/manifest.xml")
+ .setURI(rootUri).call();
+ // Clone it
+ File directory = createTempDirectory("testBareRepo");
+ 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());
+ // The first line of .gitmodules file should be expected
+ BufferedReader reader = new BufferedReader(new FileReader(gitmodules));
+ String content = reader.readLine();
+ reader.close();
+ assertEquals("The first line of .gitmodules file should be as expected",
+ "[submodule \"foo\"]", content);
+ // The gitlink should be the same as remote head sha1
+ String gitlink = localDb.resolve(Constants.HEAD + ":foo").name();
+ localDb.close();
+ String remote = defaultDb.resolve(Constants.HEAD).name();
+ assertEquals("The gitlink should be the same as remote head", remote,
+ gitlink);
}
@Test
@@ -370,208 +482,192 @@ public class RepoCommandTest extends RepositoryTestCase {
@Test
public void testRevisionBare() throws Exception {
- try (
- 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=\"").append(BRANCH)
- .append("\" remote=\"remote1\" />")
- .append("<project path=\"foo\" name=\"").append(defaultUri)
- .append("\" />").append("</manifest>");
- JGitTestUtil.writeTrashFile(tempDb, "manifest.xml",
- xmlContent.toString());
- RepoCommand command = new RepoCommand(remoteDb);
- command.setPath(
- tempDb.getWorkTree().getAbsolutePath() + "/manifest.xml")
- .setURI(rootUri).call();
- // Clone it
- File directory = createTempDirectory("testRevisionBare");
- Repository localDb = Git.cloneRepository().setDirectory(directory)
- .setURI(remoteDb.getDirectory().toURI().toString()).call()
- .getRepository();
- // The gitlink should be the same as oldCommitId
- String gitlink = localDb.resolve(Constants.HEAD + ":foo").name();
- localDb.close();
- assertEquals("The gitlink is same as remote head",
- oldCommitId.name(), gitlink);
- }
+ 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=\"").append(BRANCH)
+ .append("\" remote=\"remote1\" />")
+ .append("<project path=\"foo\" name=\"").append(defaultUri)
+ .append("\" />").append("</manifest>");
+ JGitTestUtil.writeTrashFile(tempDb, "manifest.xml",
+ xmlContent.toString());
+ RepoCommand command = new RepoCommand(remoteDb);
+ command.setPath(
+ tempDb.getWorkTree().getAbsolutePath() + "/manifest.xml")
+ .setURI(rootUri).call();
+ // Clone it
+ File directory = createTempDirectory("testRevisionBare");
+ Repository localDb = Git.cloneRepository().setDirectory(directory)
+ .setURI(remoteDb.getDirectory().toURI().toString()).call()
+ .getRepository();
+ // The gitlink should be the same as oldCommitId
+ Stri