From d76088bca6077579f5b8fe669147a31ce7bbd6ad Mon Sep 17 00:00:00 2001 From: Nail Samatov Date: Tue, 27 Oct 2020 16:56:24 +0300 Subject: [PATCH 1/8] Fix IOException occurring during gc Fix IOException occurring when calling GC on a repository with absent objects/pack folder. Change-Id: I5be1333a0726f4d7491afd25ddac85451686c30a Signed-off-by: Nail Samatov Signed-off-by: Matthias Sohn --- .../storage/file/GcBasicPackingTest.java | 23 +++++++++++++++++++ .../jgit/internal/storage/file/GC.java | 1 + 2 files changed, 24 insertions(+) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcBasicPackingTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcBasicPackingTest.java index e8d1cd3d7..d007dd451 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcBasicPackingTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcBasicPackingTest.java @@ -79,6 +79,29 @@ public void testPack2Commits(boolean aggressive) throws Exception { assertEquals(2, stats.numberOfBitmaps); } + @Theory + public void testPack2Commits_noPackFolder(boolean aggressive) throws Exception { + File packDir = repo.getObjectDatabase().getPackDirectory(); + assertTrue(packDir.delete()); + + BranchBuilder bb = tr.branch("refs/heads/master"); + bb.commit().add("A", "A").add("B", "B").create(); + bb.commit().add("A", "A2").add("B", "B2").create(); + + stats = gc.getStatistics(); + assertEquals(8, stats.numberOfLooseObjects); + assertEquals(0, stats.numberOfPackedObjects); + configureGc(gc, aggressive); + gc.gc(); + stats = gc.getStatistics(); + assertEquals(0, stats.numberOfLooseObjects); + assertEquals(8, stats.numberOfPackedObjects); + assertEquals(1, stats.numberOfPackFiles); + assertEquals(2, stats.numberOfBitmaps); + + assertTrue(packDir.exists()); + } + @Theory public void testPackAllObjectsInOnePack(boolean aggressive) throws Exception { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java index e4324c1a8..741d86e67 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java @@ -1166,6 +1166,7 @@ private PackFile writePack(@NonNull Set want, // create temporary files String id = pw.computeName().getName(); File packdir = repo.getObjectDatabase().getPackDirectory(); + packdir.mkdirs(); tmpPack = File.createTempFile("gc_", ".pack_tmp", packdir); //$NON-NLS-1$ //$NON-NLS-2$ final String tmpBase = tmpPack.getName() .substring(0, tmpPack.getName().lastIndexOf('.')); From 4f3161d3cc1af6ff725d6e7fb21909001df62705 Mon Sep 17 00:00:00 2001 From: Alexa Panfil Date: Fri, 23 Oct 2020 17:23:23 +0000 Subject: [PATCH 2/8] Fix bug in PerformanceLogContext PerformanceLogContext threw NullPointerException when multiple threads tried to add an event to the PerformanceLogContext. The cause for this is that the ThreadLocal was initialized only in the class constructor for the first thread; for subsequent threads it was null. To fix this initialize eventRecords for each thread. Change-Id: I18ef67dff8f0488e3ad28c9bbc18ce73d5168cf9 Signed-off-by: Alexa Panfil Signed-off-by: Matthias Sohn --- .../logging/PerformanceLogContextTest.java | 45 +++++++++++++++---- .../jgit/logging/PerformanceLogContext.java | 6 +-- 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/logging/PerformanceLogContextTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/logging/PerformanceLogContextTest.java index e061833d1..f3c1ddec8 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/logging/PerformanceLogContextTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/logging/PerformanceLogContextTest.java @@ -1,6 +1,7 @@ package org.eclipse.jgit.logging; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Test; @@ -37,30 +38,58 @@ public void testCleanEvents() { } @Test - public void testAddEventsTwoThreads() { - TestRunnable thread1 = new TestRunnable("record1", 1); - TestRunnable thread2 = new TestRunnable("record2", 2); + public void testAddEventsTwoThreads() throws InterruptedException { + TestRunnable runnable1 = new TestRunnable("record1", 1); + TestRunnable runnable2 = new TestRunnable("record2", 2); - new Thread(thread1).start(); - new Thread(thread2).start(); + Thread thread1 = new Thread(runnable1); + Thread thread2 = new Thread(runnable2); + + thread1.start(); + thread2.start(); + + thread1.join(); + thread2.join(); + assertEquals(1, runnable1.getEventRecordsCount()); + assertEquals(1, runnable2.getEventRecordsCount()); + assertFalse(runnable1.isThrown()); + assertFalse(runnable2.isThrown()); } private static class TestRunnable implements Runnable { private String name; + private long durationMs; + private long eventRecordsCount; + + private boolean thrown = false; + public TestRunnable(String name, long durationMs) { this.name = name; this.durationMs = durationMs; } + public boolean isThrown() { + return thrown; + } + + public long getEventRecordsCount() { + return eventRecordsCount; + } + @Override public void run() { PerformanceLogRecord record = new PerformanceLogRecord(name, durationMs); - PerformanceLogContext.getInstance().addEvent(record); - assertEquals(1, PerformanceLogContext.getInstance() - .getEventRecords().size()); + try { + PerformanceLogContext.getInstance().addEvent(record); + eventRecordsCount = PerformanceLogContext.getInstance() + .getEventRecords().size(); + PerformanceLogContext.getInstance().cleanEvents(); + } catch (Exception e) { + thrown = true; + } } } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/logging/PerformanceLogContext.java b/org.eclipse.jgit/src/org/eclipse/jgit/logging/PerformanceLogContext.java index 4421efd7f..fab0dd102 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/logging/PerformanceLogContext.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/logging/PerformanceLogContext.java @@ -24,10 +24,10 @@ public class PerformanceLogContext { private static final PerformanceLogContext INSTANCE = new PerformanceLogContext(); /** List that stores events as performance logs. */ - private final ThreadLocal> eventRecords = new ThreadLocal<>(); + private static final ThreadLocal> eventRecords = ThreadLocal + .withInitial(ArrayList::new); private PerformanceLogContext() { - eventRecords.set(new ArrayList<>()); } /** @@ -62,6 +62,6 @@ public void addEvent(PerformanceLogRecord record) { * Removes all of the existing records from the current list of events. */ public void cleanEvents() { - eventRecords.get().clear(); + eventRecords.remove(); } } \ No newline at end of file From f39f848c99e4313e4dbd860744a5b4b864e060bf Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Mon, 17 Aug 2020 14:23:29 +0200 Subject: [PATCH 3/8] Document that setLastModified sets time of symlink target Due to Java bug JDK-8220793 [1] Java cannot set timestamps of a symlink but only of the symlink target. This bug was fixed in Java 13. Since we don't have a use case to set the timestamp of the symlink itself simply document the current behavior of setLastModified methods. [1] https://bugs.openjdk.java.net/browse/JDK-8220793 Change-Id: Ibc28c1702a1b9845602bd257606fbd44803a43fb Signed-off-by: Matthias Sohn --- org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java | 10 ++++++---- .../src/org/eclipse/jgit/util/FileUtils.java | 4 ++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java index bf7b75369..d8cab358e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java @@ -1080,8 +1080,9 @@ public Instant lastModifiedInstant(File f) { } /** - * Set the last modified time of a file system object. If the OS/JRE support - * symbolic links, the link is modified, not the target, + * Set the last modified time of a file system object. + *

+ * For symlinks it sets the modified time of the link target. * * @param f * a {@link java.io.File} object. @@ -1097,8 +1098,9 @@ public void setLastModified(File f, long time) throws IOException { } /** - * Set the last modified time of a file system object. If the OS/JRE support - * symbolic links, the link is modified, not the target, + * Set the last modified time of a file system object. + *

+ * For symlinks it sets the modified time of the link target. * * @param p * a {@link Path} object. diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java index c43956e53..aa39a4464 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java @@ -710,6 +710,8 @@ static BasicFileAttributes fileAttributes(File file) throws IOException { } /** + * Set the last modified time of a file system object. + * * @param file * @param time * @throws IOException @@ -720,6 +722,8 @@ static void setLastModified(File file, long time) throws IOException { } /** + * Set the last modified time of a file system object. + * * @param path * @param time * @throws IOException From ff6a827f4fa97815eac3b1a1ec53da8dfea41dd0 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Sat, 14 Nov 2020 21:48:31 +0100 Subject: [PATCH 4/8] Update Orbit to I20201111205634 and update - org.apache.ant to 1.10.9.v20201106-1946 - org.slf4j.binding.log4j12 to 1.7.30.v20201108-2042 Change-Id: Id15d14dea3a61dabde974c3ea9332d47fb19f4d9 Signed-off-by: Matthias Sohn --- .../org.eclipse.jgit.target/jgit-4.10.target | 12 ++++++------ .../org.eclipse.jgit.target/jgit-4.10.tpd | 2 +- .../org.eclipse.jgit.target/jgit-4.11.target | 12 ++++++------ .../org.eclipse.jgit.target/jgit-4.11.tpd | 2 +- .../org.eclipse.jgit.target/jgit-4.12.target | 12 ++++++------ .../org.eclipse.jgit.target/jgit-4.12.tpd | 2 +- .../org.eclipse.jgit.target/jgit-4.13.target | 12 ++++++------ .../org.eclipse.jgit.target/jgit-4.13.tpd | 2 +- .../org.eclipse.jgit.target/jgit-4.14.target | 12 ++++++------ .../org.eclipse.jgit.target/jgit-4.14.tpd | 2 +- .../org.eclipse.jgit.target/jgit-4.15.target | 12 ++++++------ .../org.eclipse.jgit.target/jgit-4.15.tpd | 2 +- .../org.eclipse.jgit.target/jgit-4.16.target | 12 ++++++------ .../org.eclipse.jgit.target/jgit-4.16.tpd | 2 +- .../org.eclipse.jgit.target/jgit-4.17-staging.target | 12 ++++++------ .../org.eclipse.jgit.target/jgit-4.17-staging.tpd | 2 +- .../org.eclipse.jgit.target/jgit-4.6.target | 12 ++++++------ .../org.eclipse.jgit.target/jgit-4.6.tpd | 2 +- .../org.eclipse.jgit.target/jgit-4.7.target | 12 ++++++------ .../org.eclipse.jgit.target/jgit-4.7.tpd | 2 +- .../org.eclipse.jgit.target/jgit-4.8.target | 12 ++++++------ .../org.eclipse.jgit.target/jgit-4.8.tpd | 2 +- .../org.eclipse.jgit.target/jgit-4.9.target | 12 ++++++------ .../org.eclipse.jgit.target/jgit-4.9.tpd | 2 +- .../{S20201027182932.tpd => I20201111205634.tpd} | 12 ++++++------ 25 files changed, 90 insertions(+), 90 deletions(-) rename org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/{S20201027182932.tpd => I20201111205634.tpd} (91%) diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.target index 6eac67ff0..c22bca7fb 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.target @@ -1,7 +1,7 @@ - + @@ -39,8 +39,8 @@ - - + + @@ -80,11 +80,11 @@ - - + + - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.tpd index 7b0abe3ec..df414339c 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.tpd @@ -1,7 +1,7 @@ target "jgit-4.10" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/S20201027182932.tpd" +include "orbit/I20201111205634.tpd" location "https://download.eclipse.org/releases/2018-12/" { org.eclipse.osgi lazy diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.target index a3f3013a7..57ea8125c 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.target @@ -1,7 +1,7 @@ - + @@ -39,8 +39,8 @@ - - + + @@ -80,11 +80,11 @@ - - + + - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.tpd index 9cbf9169a..c499769bb 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.tpd @@ -1,7 +1,7 @@ target "jgit-4.11" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/S20201027182932.tpd" +include "orbit/I20201111205634.tpd" location "https://download.eclipse.org/releases/2019-03/" { org.eclipse.osgi lazy diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.target index 451ee96fc..006710b79 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.target @@ -1,7 +1,7 @@ - + @@ -39,8 +39,8 @@ - - + + @@ -80,11 +80,11 @@ - - + + - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.tpd index e15c357bc..1fd2e6392 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.tpd @@ -1,7 +1,7 @@ target "jgit-4.12" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/S20201027182932.tpd" +include "orbit/I20201111205634.tpd" location "https://download.eclipse.org/releases/2019-06/" { org.eclipse.osgi lazy diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.13.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.13.target index b0b791038..a513c18e3 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.13.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.13.target @@ -1,7 +1,7 @@ - + @@ -39,8 +39,8 @@ - - + + @@ -80,11 +80,11 @@ - - + + - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.13.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.13.tpd index b2d4aed91..ab7fb5194 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.13.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.13.tpd @@ -1,7 +1,7 @@ target "jgit-4.13" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/S20201027182932.tpd" +include "orbit/I20201111205634.tpd" location "https://download.eclipse.org/releases/2019-09/" { org.eclipse.osgi lazy diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.target index a2e25d5fc..21b679ce8 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.target @@ -1,7 +1,7 @@ - + @@ -39,8 +39,8 @@ - - + + @@ -80,11 +80,11 @@ - - + + - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.tpd index b5b4ce8bf..748092f3d 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.tpd @@ -1,7 +1,7 @@ target "jgit-4.14" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/S20201027182932.tpd" +include "orbit/I20201111205634.tpd" location "https://download.eclipse.org/releases/2019-12/201912181000/" { org.eclipse.osgi lazy diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.15.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.15.target index 70f5a8223..d4a0f864f 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.15.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.15.target @@ -1,7 +1,7 @@ - + @@ -39,8 +39,8 @@ - - + + @@ -80,11 +80,11 @@ - - + + - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.15.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.15.tpd index c12e2b768..dcebfbb32 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.15.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.15.tpd @@ -1,7 +1,7 @@ target "jgit-4.15" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/S20201027182932.tpd" +include "orbit/I20201111205634.tpd" location "https://download.eclipse.org/releases/2020-03/202003181000/" { org.eclipse.osgi lazy diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.16.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.16.target index 804e96f61..0309da973 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.16.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.16.target @@ -1,7 +1,7 @@ - + @@ -39,8 +39,8 @@ - - + + @@ -80,11 +80,11 @@ - - + + - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.16.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.16.tpd index 2c518b220..9deca9dad 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.16.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.16.tpd @@ -1,7 +1,7 @@ target "jgit-4.16" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/S20201027182932.tpd" +include "orbit/I20201111205634.tpd" location "https://download.eclipse.org/releases/2020-06/" { org.eclipse.osgi lazy diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17-staging.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17-staging.target index 589c7f5d5..910305437 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17-staging.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17-staging.target @@ -1,7 +1,7 @@ - + @@ -39,8 +39,8 @@ - - + + @@ -80,11 +80,11 @@ - - + + - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17-staging.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17-staging.tpd index d440efa51..20e68a837 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17-staging.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17-staging.tpd @@ -1,7 +1,7 @@ target "jgit-4.17-staging" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/S20201027182932.tpd" +include "orbit/I20201111205634.tpd" location "https://download.eclipse.org/staging/2020-09/" { org.eclipse.osgi lazy diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target index ac5c0d188..a3f333da0 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 @@ - + @@ -39,8 +39,8 @@ - - + + @@ -80,11 +80,11 @@ - - + + - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.tpd index f421ab758..89b36569c 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.tpd @@ -1,7 +1,7 @@ target "jgit-4.6" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/S20201027182932.tpd" +include "orbit/I20201111205634.tpd" location "https://download.eclipse.org/releases/neon/" { org.eclipse.osgi lazy 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 002f07db7..a2a1c55e9 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 @@ - + @@ -39,8 +39,8 @@ - - + + @@ -80,11 +80,11 @@ - - + + - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.tpd index 7b59dee0a..561c88ffa 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.tpd @@ -1,7 +1,7 @@ target "jgit-4.7" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/S20201027182932.tpd" +include "orbit/I20201111205634.tpd" location "https://download.eclipse.org/releases/oxygen/" { org.eclipse.osgi lazy diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.target index c0bc168bd..10652f279 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.target @@ -1,7 +1,7 @@ - + @@ -39,8 +39,8 @@ - - + + @@ -80,11 +80,11 @@ - - + + - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.tpd index 80d1103cb..96c6f5675 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.tpd @@ -1,7 +1,7 @@ target "jgit-4.8" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/S20201027182932.tpd" +include "orbit/I20201111205634.tpd" location "https://download.eclipse.org/releases/photon/" { org.eclipse.osgi lazy diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.target index d45d3367c..b5fbbb12e 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.target @@ -1,7 +1,7 @@ - + @@ -39,8 +39,8 @@ - - + + @@ -80,11 +80,11 @@ - - + + - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.tpd index e73b958c1..e6c98eaf0 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.tpd @@ -1,7 +1,7 @@ target "jgit-4.9" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/S20201027182932.tpd" +include "orbit/I20201111205634.tpd" location "https://download.eclipse.org/releases/2018-09/" { org.eclipse.osgi lazy diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/S20201027182932.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/I20201111205634.tpd similarity index 91% rename from org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/S20201027182932.tpd rename to org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/I20201111205634.tpd index 3276402f8..9d8192aee 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/S20201027182932.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/I20201111205634.tpd @@ -1,7 +1,7 @@ -target "S20201027182932" with source configurePhase +target "I20201111205634" with source configurePhase // see https://download.eclipse.org/tools/orbit/downloads/ -location "https://download.eclipse.org/tools/orbit/downloads/drops/S20201027182932/repository" { +location "https://download.eclipse.org/tools/orbit/downloads/drops/I20201111205634/repository" { com.google.gson [2.8.2.v20180104-1110,2.8.2.v20180104-1110] com.google.gson.source [2.8.2.v20180104-1110,2.8.2.v20180104-1110] com.jcraft.jsch [0.1.55.v20190404-1902,0.1.55.v20190404-1902] @@ -18,8 +18,8 @@ location "https://download.eclipse.org/tools/orbit/downloads/drops/S202010271829 net.bytebuddy.byte-buddy.source [1.9.0.v20181107-1410,1.9.0.v20181107-1410] net.i2p.crypto.eddsa [0.3.0.v20181102-1323,0.3.0.v20181102-1323] net.i2p.crypto.eddsa.source [0.3.0.v20181102-1323,0.3.0.v20181102-1323] - org.apache.ant [1.10.8.v20200515-1239,1.10.8.v20200515-1239] - org.apache.ant.source [1.10.8.v20200515-1239,1.10.8.v20200515-1239] + org.apache.ant [1.10.9.v20201106-1946,1.10.9.v20201106-1946] + org.apache.ant.source [1.10.9.v20201106-1946,1.10.9.v20201106-1946] org.apache.commons.codec [1.14.0.v20200818-1422,1.14.0.v20200818-1422] org.apache.commons.codec.source [1.14.0.v20200818-1422,1.14.0.v20200818-1422] org.apache.commons.compress [1.19.0.v20200106-2343,1.19.0.v20200106-2343] @@ -59,8 +59,8 @@ location "https://download.eclipse.org/tools/orbit/downloads/drops/S202010271829 org.objenesis.source [2.6.0.v20180420-1519,2.6.0.v20180420-1519] org.slf4j.api [1.7.30.v20200204-2150,1.7.30.v20200204-2150] org.slf4j.api.source [1.7.30.v20200204-2150,1.7.30.v20200204-2150] - org.slf4j.binding.log4j12 [1.7.30.v20201016-1131,1.7.30.v20201016-1131] - org.slf4j.binding.log4j12.source [1.7.30.v20201016-1131,1.7.30.v20201016-1131] + org.slf4j.binding.log4j12 [1.7.30.v20201108-2042,1.7.30.v20201108-2042] + org.slf4j.binding.log4j12.source [1.7.30.v20201108-2042,1.7.30.v20201108-2042] org.tukaani.xz [1.8.0.v20180207-1613,1.8.0.v20180207-1613] org.tukaani.xz.source [1.8.0.v20180207-1613,1.8.0.v20180207-1613] } From e84881ea6b67c6c3239df4e42cf73ffdadc13d56 Mon Sep 17 00:00:00 2001 From: Thomas Wolf Date: Sun, 15 Nov 2020 18:45:12 +0100 Subject: [PATCH 5/8] Allow to resolve a conflict by checking out a file DirCacheEditor unconditionally applied a PathEdit to all stages in the index. This gives wrong results if one wants to check out a file from some commit to resolve a conflict: JGit would update the working tree file multiple times (once per stage), and set all stages to point to the checked-out blob. C git replaces the stages by the entry for the checked-out file. To support this, add a DirCacheEntry.setStage() method so that CheckoutCommand can force the stage to zero. In DirCacheEditor, keep only the zero stage if the PathEdit re-set the stage. Bug: 568038 Change-Id: Ic7c635bb5aaa06ffaaeed50bc5e45702c56fc6d1 Signed-off-by: Thomas Wolf --- .../jgit/api/PathCheckoutCommandTest.java | 13 +++++- .../jgit/dircache/DirCacheEntryTest.java | 40 +++++++++++++++++++ .../jgit/dircache/DirCachePathEditTest.java | 28 ++++++++++++- .../org/eclipse/jgit/api/CheckoutCommand.java | 7 +++- .../eclipse/jgit/dircache/DirCacheEditor.java | 32 ++++++++++++--- .../eclipse/jgit/dircache/DirCacheEntry.java | 18 +++++++++ 6 files changed, 129 insertions(+), 9 deletions(-) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PathCheckoutCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PathCheckoutCommandTest.java index e0a1c1d61..f52b715d3 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PathCheckoutCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PathCheckoutCommandTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011, Kevin Sawicki and others + * Copyright (C) 2011, 2020 Kevin Sawicki and others * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0 which is available at @@ -24,6 +24,7 @@ import org.eclipse.jgit.errors.NoWorkTreeException; import org.eclipse.jgit.junit.RepositoryTestCase; import org.eclipse.jgit.lib.ConfigConstants; +import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.ObjectReader; import org.eclipse.jgit.lib.RepositoryState; import org.eclipse.jgit.lib.StoredConfig; @@ -309,6 +310,16 @@ public void testCheckoutTheirs() throws Exception { assertStageOneToThree(FILE1); } + @Test + public void testCheckoutFileWithConflict() throws Exception { + setupConflictingState(); + assertEquals('[' + FILE1 + ']', + git.status().call().getConflicting().toString()); + git.checkout().setStartPoint(Constants.HEAD).addPath(FILE1).call(); + assertEquals("3", read(FILE1)); + assertTrue(git.status().call().isClean()); + } + @Test public void testCheckoutOursWhenNoBase() throws Exception { String file = "added.txt"; diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheEntryTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheEntryTest.java index 5477f565f..8e84dfa31 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheEntryTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheEntryTest.java @@ -241,6 +241,46 @@ public void testSetFileMode() { } } + @Test + public void testSetStage() { + DirCacheEntry e = new DirCacheEntry("some/path", DirCacheEntry.STAGE_1); + e.setAssumeValid(true); + e.setCreationTime(2L); + e.setFileMode(FileMode.EXECUTABLE_FILE); + e.setLastModified(EPOCH.plusMillis(3L)); + e.setLength(100L); + e.setObjectId(ObjectId + .fromString("0123456789012345678901234567890123456789")); + e.setUpdateNeeded(true); + e.setStage(DirCacheEntry.STAGE_2); + + assertTrue(e.isAssumeValid()); + assertEquals(2L, e.getCreationTime()); + assertEquals( + ObjectId.fromString("0123456789012345678901234567890123456789"), + e.getObjectId()); + assertEquals(FileMode.EXECUTABLE_FILE, e.getFileMode()); + assertEquals(EPOCH.plusMillis(3L), e.getLastModifiedInstant()); + assertEquals(100L, e.getLength()); + assertEquals(DirCacheEntry.STAGE_2, e.getStage()); + assertTrue(e.isUpdateNeeded()); + assertEquals("some/path", e.getPathString()); + + e.setStage(DirCacheEntry.STAGE_0); + + assertTrue(e.isAssumeValid()); + assertEquals(2L, e.getCreationTime()); + assertEquals( + ObjectId.fromString("0123456789012345678901234567890123456789"), + e.getObjectId()); + assertEquals(FileMode.EXECUTABLE_FILE, e.getFileMode()); + assertEquals(EPOCH.plusMillis(3L), e.getLastModifiedInstant()); + assertEquals(100L, e.getLength()); + assertEquals(DirCacheEntry.STAGE_0, e.getStage()); + assertTrue(e.isUpdateNeeded()); + assertEquals("some/path", e.getPathString()); + } + @Test public void testCopyMetaDataWithStage() { copyMetaDataHelper(false); 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 39a1f0180..5778d28d6 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011, Robin Rosenberg and others + * Copyright (C) 2011, 2020 Robin Rosenberg and others * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0 which is available at @@ -123,6 +123,32 @@ public void testPathEditShouldBeCalledForEachStage() throws Exception { assertEquals(DirCacheEntry.STAGE_3, entries.get(2).getStage()); } + @Test + public void testPathEditWithStagesAndReset() throws Exception { + DirCache dc = DirCache.newInCore(); + DirCacheBuilder builder = new DirCacheBuilder(dc, 3); + builder.add(createEntry("a", DirCacheEntry.STAGE_1)); + builder.add(createEntry("a", DirCacheEntry.STAGE_2)); + builder.add(createEntry("a", DirCacheEntry.STAGE_3)); + builder.finish(); + + DirCacheEditor editor = dc.editor(); + PathEdit edit = new PathEdit("a") { + + @Override + public void apply(DirCacheEntry ent) { + ent.setStage(DirCacheEntry.STAGE_0); + } + }; + editor.add(edit); + editor.finish(); + + assertEquals(1, dc.getEntryCount()); + DirCacheEntry entry = dc.getEntry(0); + assertEquals("a", entry.getPathString()); + assertEquals(DirCacheEntry.STAGE_0, entry.getStage()); + } + @Test public void testFileReplacesTree() throws Exception { DirCache dc = DirCache.newInCore(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java index 0dc5d5e7f..847ab0a9a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2010, Chris Aniszczyk - * Copyright (C) 2011, Matthias Sohn and others + * Copyright (C) 2011, 2020 Matthias Sohn and others * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0 which is available at @@ -503,6 +503,11 @@ private void checkoutPathsFromCommit(TreeWalk treeWalk, DirCache dc, editor.add(new PathEdit(path) { @Override public void apply(DirCacheEntry ent) { + if (ent.getStage() != DirCacheEntry.STAGE_0) { + // A checkout on a conflicting file stages the checked + // out file and resolves the conflict. + ent.setStage(DirCacheEntry.STAGE_0); + } ent.setObjectId(blobId); ent.setFileMode(mode); checkoutPath(ent, r, diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java index 73d2807ea..8c342e267 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java @@ -1,6 +1,6 @@ /* - * Copyright (C) 2008-2009, Google Inc. - * Copyright (C) 2008, Shawn O. Pearce and others + * Copyright (C) 2008, 2009, Google Inc. + * Copyright (C) 2008, 2020 Shawn O. Pearce and others * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0 which is available at @@ -139,10 +139,28 @@ private void applyEdits() { : eIdx; fastAdd(ent); } else { - // Apply to all entries of the current path (different stages) lastIdx = cache.nextEntry(eIdx); - for (int i = eIdx; i < lastIdx; i++) { - final DirCacheEntry ent = cache.getEntry(i); + if (lastIdx > eIdx + 1) { + // Apply to all entries of the current path (different + // stages). If any apply() resets the stage to STAGE_0, take + // only that entry and omit all others. + DirCacheEntry[] tmp = new DirCacheEntry[lastIdx - eIdx]; + int n = 0; + for (int i = eIdx; i < lastIdx; i++) { + DirCacheEntry ent = cache.getEntry(i); + e.apply(ent); + if (ent.getStage() == DirCacheEntry.STAGE_0) { + fastAdd(ent); + n = 0; + break; + } + tmp[n++] = ent; + } + for (int i = 0; i < n; i++) { + fastAdd(tmp[i]); + } + } else { + DirCacheEntry ent = cache.getEntry(eIdx); e.apply(ent); fastAdd(ent); } @@ -257,7 +275,9 @@ private static int pdir(byte[] path, int e) { * {@link #apply(DirCacheEntry)} method. The editor will invoke apply once * for each record in the index which matches the path name. If there are * multiple records (for example in stages 1, 2 and 3), the edit instance - * will be called multiple times, once for each stage. + * will be called multiple times, once for each stage. If any of these calls + * resets the stage to 0, only this entry will be taken and entries for + * other stages are discarded. */ public abstract static class PathEdit { final byte[] path; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java index dcb84825f..67edf50f4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java @@ -541,6 +541,24 @@ public int getStage() { return (info[infoOffset + P_FLAGS] >>> 4) & 0x3; } + /** + * Sets the stage of an entry. + * + * @param stage + * to set, in the range [0..3] + * @throws IllegalArgumentException + * if the stage is outside the range [0..3] + * @since 5.10 + */ + public void setStage(int stage) { + if ((stage & ~0x3) != 0) { + throw new IllegalArgumentException( + "Invalid stage, must be in range [0..3]"); //$NON-NLS-1$ + } + byte flags = info[infoOffset + P_FLAGS]; + info[infoOffset + P_FLAGS] = (byte) ((flags & 0xCF) | (stage << 4)); + } + /** * Returns whether this entry should be skipped from the working tree. * From 7da0f0a8f37e35e9c3108588f1e6f7a7381d8f77 Mon Sep 17 00:00:00 2001 From: Thomas Wolf Date: Thu, 19 Nov 2020 13:23:05 +0100 Subject: [PATCH 6/8] PacketLineIn: ensure that END != DELIM Just allocate the two string objects directly. The previously used new StringBuilder(0).toString() returns the same object for both END and DELIM when run on Java 15, which breaks the wire protocol since then END and DELIM cannot be distinguished anymore. Bug: 568950 Change-Id: I9d54d7bf484948c24b51a094256bd9d38b085f35 Signed-off-by: Thomas Wolf --- .../src/org/eclipse/jgit/transport/PacketLineIn.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java index 52a5576e4..350311ecc 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java @@ -1,7 +1,7 @@ /* - * Copyright (C) 2008-2010, Google Inc. - * Copyright (C) 2008-2009, Robin Rosenberg - * Copyright (C) 2008, Shawn O. Pearce and others + * Copyright (C) 2008, 2010 Google Inc. + * Copyright (C) 2008, 2009 Robin Rosenberg + * Copyright (C) 2008, 2020 Shawn O. Pearce and others * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0 which is available at @@ -50,7 +50,7 @@ public class PacketLineIn { * strings in the input stream until the marker is reached. */ @Deprecated - public static final String END = new StringBuilder(0).toString(); /* must not string pool */ + public static final String END = new String(); /* must not string pool */ /** * Magic return from {@link #readString()} when a delim packet is found. @@ -60,7 +60,7 @@ public class PacketLineIn { * string is the delimiter. */ @Deprecated - public static final String DELIM = new StringBuilder(0).toString(); /* must not string pool */ + public static final String DELIM = new String(); /* must not string pool */ enum AckNackResult { /** NAK */ From e2663a8b85cf92f6a84d72834257243a84066e9d Mon Sep 17 00:00:00 2001 From: Thomas Wolf Date: Thu, 19 Nov 2020 13:23:05 +0100 Subject: [PATCH 7/8] PacketLineIn: ensure that END != DELIM Just allocate the two string objects directly. The previously used new StringBuilder(0).toString() returns the same object for both END and DELIM when run on Java 15, which breaks the wire protocol since then END and DELIM cannot be distinguished anymore. Bug: 568950 Change-Id: I9d54d7bf484948c24b51a094256bd9d38b085f35 Signed-off-by: Thomas Wolf (cherry picked from commit 7da0f0a8f37e35e9c3108588f1e6f7a7381d8f77) --- .../src/org/eclipse/jgit/transport/PacketLineIn.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java index 52a5576e4..350311ecc 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java @@ -1,7 +1,7 @@ /* - * Copyright (C) 2008-2010, Google Inc. - * Copyright (C) 2008-2009, Robin Rosenberg - * Copyright (C) 2008, Shawn O. Pearce and others + * Copyright (C) 2008, 2010 Google Inc. + * Copyright (C) 2008, 2009 Robin Rosenberg + * Copyright (C) 2008, 2020 Shawn O. Pearce and others * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0 which is available at @@ -50,7 +50,7 @@ public class PacketLineIn { * strings in the input stream until the marker is reached. */ @Deprecated - public static final String END = new StringBuilder(0).toString(); /* must not string pool */ + public static final String END = new String(); /* must not string pool */ /** * Magic return from {@link #readString()} when a delim packet is found. @@ -60,7 +60,7 @@ public class PacketLineIn { * string is the delimiter. */ @Deprecated - public static final String DELIM = new StringBuilder(0).toString(); /* must not string pool */ + public static final String DELIM = new String(); /* must not string pool */ enum AckNackResult { /** NAK */ From b8441e1e355164527ba6aeb857248190f60524ea Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Fri, 20 Nov 2020 11:05:08 +0100 Subject: [PATCH 8/8] Update Orbit to S20201118210000 and add target for 4.18 - replace target platform for 4.17 staging with final release - add target platform for Eclipse 4.18 (2020-12) Change-Id: I4fb60cc346e275b755bba8d32b1964c2673fb615 Signed-off-by: Matthias Sohn --- .../org.eclipse.jgit.target/jgit-4.10.target | 4 +- .../org.eclipse.jgit.target/jgit-4.10.tpd | 2 +- .../org.eclipse.jgit.target/jgit-4.11.target | 4 +- .../org.eclipse.jgit.target/jgit-4.11.tpd | 2 +- .../org.eclipse.jgit.target/jgit-4.12.target | 4 +- .../org.eclipse.jgit.target/jgit-4.12.tpd | 2 +- .../org.eclipse.jgit.target/jgit-4.13.target | 4 +- .../org.eclipse.jgit.target/jgit-4.13.tpd | 2 +- .../org.eclipse.jgit.target/jgit-4.14.target | 4 +- .../org.eclipse.jgit.target/jgit-4.14.tpd | 2 +- .../org.eclipse.jgit.target/jgit-4.15.target | 4 +- .../org.eclipse.jgit.target/jgit-4.15.tpd | 2 +- .../org.eclipse.jgit.target/jgit-4.16.target | 4 +- .../org.eclipse.jgit.target/jgit-4.16.tpd | 2 +- .../jgit-4.17-staging.tpd | 8 -- .../org.eclipse.jgit.target/jgit-4.17.target | 94 +++++++++++++++++++ .../org.eclipse.jgit.target/jgit-4.17.tpd | 8 ++ ...taging.target => jgit-4.18-staging.target} | 6 +- .../jgit-4.18-staging.tpd | 8 ++ .../org.eclipse.jgit.target/jgit-4.6.target | 4 +- .../org.eclipse.jgit.target/jgit-4.6.tpd | 2 +- .../org.eclipse.jgit.target/jgit-4.7.target | 4 +- .../org.eclipse.jgit.target/jgit-4.7.tpd | 2 +- .../org.eclipse.jgit.target/jgit-4.8.target | 4 +- .../org.eclipse.jgit.target/jgit-4.8.tpd | 2 +- .../org.eclipse.jgit.target/jgit-4.9.target | 4 +- .../org.eclipse.jgit.target/jgit-4.9.tpd | 2 +- ...20201111205634.tpd => S20201118210000.tpd} | 4 +- 28 files changed, 148 insertions(+), 46 deletions(-) delete mode 100644 org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17-staging.tpd create mode 100644 org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17.target create mode 100644 org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17.tpd rename org.eclipse.jgit.packaging/org.eclipse.jgit.target/{jgit-4.17-staging.target => jgit-4.18-staging.target} (98%) create mode 100644 org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.18-staging.tpd rename org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/{I20201111205634.tpd => S20201118210000.tpd} (98%) diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.target index c22bca7fb..931e196cf 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.target @@ -1,7 +1,7 @@ - + @@ -84,7 +84,7 @@ - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.tpd index df414339c..b87917b8a 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.tpd @@ -1,7 +1,7 @@ target "jgit-4.10" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/I20201111205634.tpd" +include "orbit/S20201118210000.tpd" location "https://download.eclipse.org/releases/2018-12/" { org.eclipse.osgi lazy diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.target index 57ea8125c..809099960 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.target @@ -1,7 +1,7 @@ - + @@ -84,7 +84,7 @@ - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.tpd index c499769bb..844a1d791 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.tpd @@ -1,7 +1,7 @@ target "jgit-4.11" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/I20201111205634.tpd" +include "orbit/S20201118210000.tpd" location "https://download.eclipse.org/releases/2019-03/" { org.eclipse.osgi lazy diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.target index 006710b79..69eb63972 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.target @@ -1,7 +1,7 @@ - + @@ -84,7 +84,7 @@ - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.tpd index 1fd2e6392..afbf79d53 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.tpd @@ -1,7 +1,7 @@ target "jgit-4.12" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/I20201111205634.tpd" +include "orbit/S20201118210000.tpd" location "https://download.eclipse.org/releases/2019-06/" { org.eclipse.osgi lazy diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.13.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.13.target index a513c18e3..fdbed2d2a 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.13.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.13.target @@ -1,7 +1,7 @@ - + @@ -84,7 +84,7 @@ - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.13.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.13.tpd index ab7fb5194..d83e33846 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.13.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.13.tpd @@ -1,7 +1,7 @@ target "jgit-4.13" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/I20201111205634.tpd" +include "orbit/S20201118210000.tpd" location "https://download.eclipse.org/releases/2019-09/" { org.eclipse.osgi lazy diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.target index 21b679ce8..c2ef9d24a 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.target @@ -1,7 +1,7 @@ - + @@ -84,7 +84,7 @@ - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.tpd index 748092f3d..f357ccd24 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.tpd @@ -1,7 +1,7 @@ target "jgit-4.14" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/I20201111205634.tpd" +include "orbit/S20201118210000.tpd" location "https://download.eclipse.org/releases/2019-12/201912181000/" { org.eclipse.osgi lazy diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.15.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.15.target index d4a0f864f..4034d2a36 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.15.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.15.target @@ -1,7 +1,7 @@ - + @@ -84,7 +84,7 @@ - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.15.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.15.tpd index dcebfbb32..881fe37e7 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.15.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.15.tpd @@ -1,7 +1,7 @@ target "jgit-4.15" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/I20201111205634.tpd" +include "orbit/S20201118210000.tpd" location "https://download.eclipse.org/releases/2020-03/202003181000/" { org.eclipse.osgi lazy diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.16.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.16.target index 0309da973..34d872cdd 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.16.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.16.target @@ -1,7 +1,7 @@ - + @@ -84,7 +84,7 @@ - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.16.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.16.tpd index 9deca9dad..9a0759711 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.16.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.16.tpd @@ -1,7 +1,7 @@ target "jgit-4.16" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/I20201111205634.tpd" +include "orbit/S20201118210000.tpd" location "https://download.eclipse.org/releases/2020-06/" { org.eclipse.osgi lazy diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17-staging.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17-staging.tpd deleted file mode 100644 index 20e68a837..000000000 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17-staging.tpd +++ /dev/null @@ -1,8 +0,0 @@ -target "jgit-4.17-staging" with source configurePhase - -include "projects/jetty-9.4.x.tpd" -include "orbit/I20201111205634.tpd" - -location "https://download.eclipse.org/staging/2020-09/" { - org.eclipse.osgi lazy -} diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17.target new file mode 100644 index 000000000..3384c2356 --- /dev/null +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17.target @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17.tpd new file mode 100644 index 000000000..ce79cf45e --- /dev/null +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17.tpd @@ -0,0 +1,8 @@ +target "jgit-4.17" with source configurePhase + +include "projects/jetty-9.4.x.tpd" +include "orbit/S20201118210000.tpd" + +location "https://download.eclipse.org/releases/2020-09/" { + org.eclipse.osgi lazy +} diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17-staging.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.18-staging.target similarity index 98% rename from org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17-staging.target rename to org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.18-staging.target index 910305437..5eeab9534 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17-staging.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.18-staging.target @@ -1,7 +1,7 @@ - + @@ -84,11 +84,11 @@ - + - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.18-staging.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.18-staging.tpd new file mode 100644 index 000000000..0669490bb --- /dev/null +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.18-staging.tpd @@ -0,0 +1,8 @@ +target "jgit-4.18-staging" with source configurePhase + +include "projects/jetty-9.4.x.tpd" +include "orbit/S20201118210000.tpd" + +location "https://download.eclipse.org/staging/2020-12/" { + org.eclipse.osgi lazy +} diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target index a3f333da0..a66fcc082 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 @@ - + @@ -84,7 +84,7 @@ - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.tpd index 89b36569c..aa58b6857 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.tpd @@ -1,7 +1,7 @@ target "jgit-4.6" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/I20201111205634.tpd" +include "orbit/S20201118210000.tpd" location "https://download.eclipse.org/releases/neon/" { org.eclipse.osgi lazy 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 a2a1c55e9..4b5410a3d 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 @@ - + @@ -84,7 +84,7 @@ - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.tpd index 561c88ffa..e2264e003 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.tpd @@ -1,7 +1,7 @@ target "jgit-4.7" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/I20201111205634.tpd" +include "orbit/S20201118210000.tpd" location "https://download.eclipse.org/releases/oxygen/" { org.eclipse.osgi lazy diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.target index 10652f279..d77642745 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.target @@ -1,7 +1,7 @@ - + @@ -84,7 +84,7 @@ - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.tpd index 96c6f5675..c92ce5396 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.tpd @@ -1,7 +1,7 @@ target "jgit-4.8" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/I20201111205634.tpd" +include "orbit/S20201118210000.tpd" location "https://download.eclipse.org/releases/photon/" { org.eclipse.osgi lazy diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.target index b5fbbb12e..56002b78a 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.target @@ -1,7 +1,7 @@ - + @@ -84,7 +84,7 @@ - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.tpd index e6c98eaf0..06ccecbd5 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.tpd @@ -1,7 +1,7 @@ target "jgit-4.9" with source configurePhase include "projects/jetty-9.4.x.tpd" -include "orbit/I20201111205634.tpd" +include "orbit/S20201118210000.tpd" location "https://download.eclipse.org/releases/2018-09/" { org.eclipse.osgi lazy diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/I20201111205634.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/S20201118210000.tpd similarity index 98% rename from org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/I20201111205634.tpd rename to org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/S20201118210000.tpd index 9d8192aee..a00a5e7c8 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/I20201111205634.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/orbit/S20201118210000.tpd @@ -1,7 +1,7 @@ -target "I20201111205634" with source configurePhase +target "S20201118210000" with source configurePhase // see https://download.eclipse.org/tools/orbit/downloads/ -location "https://download.eclipse.org/tools/orbit/downloads/drops/I20201111205634/repository" { +location "https://download.eclipse.org/tools/orbit/downloads/drops/S20201118210000/repository" { com.google.gson [2.8.2.v20180104-1110,2.8.2.v20180104-1110] com.google.gson.source [2.8.2.v20180104-1110,2.8.2.v20180104-1110] com.jcraft.jsch [0.1.55.v20190404-1902,0.1.55.v20190404-1902]