From: Matthias Sohn Date: Thu, 8 Aug 2019 10:30:47 +0000 (+0200) Subject: Merge branch 'stable-5.2' into stable-5.3 X-Git-Tag: v5.3.3.201908210735-r~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fchanges%2F36%2F147236%2F2;p=jgit.git Merge branch 'stable-5.2' into stable-5.3 * stable-5.2: Fix OpenSshConfigTest#config FileSnapshot: fix bug with timestamp thresholding In LockFile#waitForStatChange wait in units of file time resolution Cache FileStoreAttributeCache per directory Fix FileSnapshot#save(long) and FileSnapshot#save(Instant) Persist minimal racy threshold and allow manual configuration Measure minimum racy interval to auto-configure FileSnapshot Reuse FileUtils to recursively delete files created by tests Fix FileAttributeCache.toString() Add test for racy git detection in FileSnapshot Repeat RefDirectoryTest.testGetRef_DiscoversModifiedLoose 100 times Fix org.eclipse.jdt.core.prefs of org.eclipse.jgit.junit Add missing javadoc in org.eclipse.jgit.junit Enhance RepeatRule to report number of failures at the end Fix FileSnapshotTests for filesystem with high timestamp resolution Retry deleting test files in FileBasedConfigTest Measure filesystem timestamp resolution already in test setup Refactor FileSnapshotTest to use NIO APIs Measure stored timestamp resolution instead of time to touch file Handle CancellationException in FileStoreAttributeCache Fix FileSnapshot#saveNoConfig Use Instant for smudge time in DirCache and DirCacheEntry Use Instant instead of milliseconds for filesystem timestamp handling Workaround SecurityException in FS#getFsTimestampResolution Fix NPE in FS$FileStoreAttributeCache.getFsTimestampResolution FS: ignore AccessDeniedException when measuring timestamp resolution Add debug trace for FileSnapshot Use FileChannel.open to touch file and set mtime to now Persist filesystem timestamp resolution and allow manual configuration Increase bazel timeout for long running tests Bazel: Fix lint warning flagged by buildifier Update bazlets to latest version Bazel: Add missing dependencies for ArchiveCommandTest Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file Add support for nanoseconds and microseconds for Config#getTimeUnit Optionally measure filesystem timestamp resolution asynchronously Delete unused FileTreeIteratorWithTimeControl FileSnapshot#equals: consider UNKNOWN_SIZE Timeout measuring file timestamp resolution after 2 seconds Fix RacyGitTests#testRacyGitDetection Change RacyGitTests to create a racy git situation in a stable way Deprecate Constants.CHARACTER_ENCODING in favor of StandardCharsets.UTF_8 Fix non-deterministic hash of archives created by ArchiveCommand Update Maven plugins ecj, plexus, error-prone Update Maven plugins and cleanup Maven warnings Make inner classes static where possible Fix API problem filters Change-Id: I238adfd3080a5fed9d64c3c757297da6ea893918 Signed-off-by: Matthias Sohn --- 718555518ded4fbcafe0c1203f0035d3251884e6 diff --cc org.eclipse.jgit.lfs.server/.settings/.api_filters index 2a47dd398b,3e60680cf7..72beb7cdfa --- a/org.eclipse.jgit.lfs.server/.settings/.api_filters +++ b/org.eclipse.jgit.lfs.server/.settings/.api_filters @@@ -3,8 -3,8 +3,8 @@@ - - - ++ + diff --cc org.eclipse.jgit.packaging/pom.xml index f4d8c4f8e1,cbb5ee5e97..22f47f59df --- a/org.eclipse.jgit.packaging/pom.xml +++ b/org.eclipse.jgit.packaging/pom.xml @@@ -47,13 -47,9 +47,9 @@@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - - 3.0 - - org.eclipse.jgit jgit.tycho.parent - 5.2.3-SNAPSHOT + 5.3.3-SNAPSHOT pom JGit Tycho Parent diff --cc org.eclipse.jgit.test/META-INF/MANIFEST.MF index 14eef1351f,e0d4ddaa5b..5533304913 --- a/org.eclipse.jgit.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.test/META-INF/MANIFEST.MF @@@ -11,55 -11,62 +11,63 @@@ Bundle-RequiredExecutionEnvironment: Ja Import-Package: com.googlecode.javaewah;version="[1.1.6,2.0.0)", com.jcraft.jsch;version="[0.1.54,0.2.0)", net.bytebuddy.dynamic.loading;version="[1.7.0,2.0.0)", + org.apache.commons.compress.archivers;version="[1.15.0,2.0)", + org.apache.commons.compress.archivers.tar;version="[1.15.0,2.0)", + org.apache.commons.compress.archivers.zip;version="[1.15.0,2.0)", + org.apache.commons.compress.compressors.bzip2;version="[1.15.0,2.0)", + org.apache.commons.compress.compressors.gzip;version="[1.15.0,2.0)", + org.apache.commons.compress.compressors.xz;version="[1.15.0,2.0)", - org.eclipse.jgit.annotations;version="[5.2.3,5.3.0)", - org.eclipse.jgit.api;version="[5.2.3,5.3.0)", - org.eclipse.jgit.api.errors;version="[5.2.3,5.3.0)", - org.eclipse.jgit.archive;version="[5.2.3,5.3.0)", - org.eclipse.jgit.attributes;version="[5.2.3,5.3.0)", - org.eclipse.jgit.awtui;version="[5.2.3,5.3.0)", - org.eclipse.jgit.blame;version="[5.2.3,5.3.0)", - org.eclipse.jgit.diff;version="[5.2.3,5.3.0)", - org.eclipse.jgit.dircache;version="[5.2.3,5.3.0)", - org.eclipse.jgit.errors;version="[5.2.3,5.3.0)", - org.eclipse.jgit.events;version="[5.2.3,5.3.0)", - org.eclipse.jgit.fnmatch;version="[5.2.3,5.3.0)", - org.eclipse.jgit.gitrepo;version="[5.2.3,5.3.0)", - org.eclipse.jgit.hooks;version="[5.2.3,5.3.0)", - org.eclipse.jgit.ignore;version="[5.2.3,5.3.0)", - org.eclipse.jgit.ignore.internal;version="[5.2.3,5.3.0)", - org.eclipse.jgit.internal;version="[5.2.3,5.3.0)", - org.eclipse.jgit.internal.fsck;version="[5.2.3,5.3.0)", - org.eclipse.jgit.internal.storage.dfs;version="[5.2.3,5.3.0)", - org.eclipse.jgit.internal.storage.file;version="[5.2.3,5.3.0)", - org.eclipse.jgit.internal.storage.io;version="[5.2.3,5.3.0)", - org.eclipse.jgit.internal.storage.pack;version="[5.2.3,5.3.0)", - org.eclipse.jgit.internal.storage.reftable;version="[5.2.3,5.3.0)", - org.eclipse.jgit.internal.storage.reftree;version="[5.2.3,5.3.0)", - org.eclipse.jgit.internal.transport.parser;version="[5.2.3,5.3.0)", - org.eclipse.jgit.junit;version="[5.2.3,5.3.0)", - org.eclipse.jgit.junit.ssh;version="[5.2.3,5.3.0)", - org.eclipse.jgit.junit.time;version="[5.2.3,5.3.0)", - org.eclipse.jgit.lfs;version="[5.2.3,5.3.0)", - org.eclipse.jgit.lib;version="[5.2.3,5.3.0)", - org.eclipse.jgit.merge;version="[5.2.3,5.3.0)", - org.eclipse.jgit.nls;version="[5.2.3,5.3.0)", - org.eclipse.jgit.notes;version="[5.2.3,5.3.0)", - org.eclipse.jgit.patch;version="[5.2.3,5.3.0)", - org.eclipse.jgit.pgm;version="[5.2.3,5.3.0)", - org.eclipse.jgit.pgm.internal;version="[5.2.3,5.3.0)", - org.eclipse.jgit.revplot;version="[5.2.3,5.3.0)", - org.eclipse.jgit.revwalk;version="[5.2.3,5.3.0)", - org.eclipse.jgit.revwalk.filter;version="[5.2.3,5.3.0)", - org.eclipse.jgit.storage.file;version="[5.2.3,5.3.0)", - org.eclipse.jgit.storage.pack;version="[5.2.3,5.3.0)", - org.eclipse.jgit.submodule;version="[5.2.3,5.3.0)", - org.eclipse.jgit.transport;version="[5.2.3,5.3.0)", - org.eclipse.jgit.transport.http;version="[5.2.3,5.3.0)", - org.eclipse.jgit.transport.resolver;version="[5.2.3,5.3.0)", - org.eclipse.jgit.treewalk;version="[5.2.3,5.3.0)", - org.eclipse.jgit.treewalk.filter;version="[5.2.3,5.3.0)", - org.eclipse.jgit.util;version="[5.2.3,5.3.0)", - org.eclipse.jgit.util.io;version="[5.2.3,5.3.0)", - org.eclipse.jgit.util.sha1;version="[5.2.3,5.3.0)", + org.bouncycastle.util.encoders;version="[1.60.0,2.0.0)", + org.eclipse.jgit.annotations;version="[5.3.3,5.4.0)", + org.eclipse.jgit.api;version="[5.3.3,5.4.0)", + org.eclipse.jgit.api.errors;version="[5.3.3,5.4.0)", ++ org.eclipse.jgit.archive;version="[5.3.3,5.4.0)", + org.eclipse.jgit.attributes;version="[5.3.3,5.4.0)", + org.eclipse.jgit.awtui;version="[5.3.3,5.4.0)", + org.eclipse.jgit.blame;version="[5.3.3,5.4.0)", + org.eclipse.jgit.diff;version="[5.3.3,5.4.0)", + org.eclipse.jgit.dircache;version="[5.3.3,5.4.0)", + org.eclipse.jgit.errors;version="[5.3.3,5.4.0)", + org.eclipse.jgit.events;version="[5.3.3,5.4.0)", + org.eclipse.jgit.fnmatch;version="[5.3.3,5.4.0)", + org.eclipse.jgit.gitrepo;version="[5.3.3,5.4.0)", + org.eclipse.jgit.hooks;version="[5.3.3,5.4.0)", + org.eclipse.jgit.ignore;version="[5.3.3,5.4.0)", + org.eclipse.jgit.ignore.internal;version="[5.3.3,5.4.0)", + org.eclipse.jgit.internal;version="[5.3.3,5.4.0)", + org.eclipse.jgit.internal.fsck;version="[5.3.3,5.4.0)", + org.eclipse.jgit.internal.storage.dfs;version="[5.3.3,5.4.0)", + org.eclipse.jgit.internal.storage.file;version="[5.3.3,5.4.0)", + org.eclipse.jgit.internal.storage.io;version="[5.3.3,5.4.0)", + org.eclipse.jgit.internal.storage.pack;version="[5.3.3,5.4.0)", + org.eclipse.jgit.internal.storage.reftable;version="[5.3.3,5.4.0)", + org.eclipse.jgit.internal.storage.reftree;version="[5.3.3,5.4.0)", + org.eclipse.jgit.internal.transport.parser;version="[5.3.3,5.4.0)", + org.eclipse.jgit.junit;version="[5.3.3,5.4.0)", + org.eclipse.jgit.junit.ssh;version="[5.3.3,5.4.0)", ++ org.eclipse.jgit.junit.time;version="[5.3.3,5.4.0)", + org.eclipse.jgit.lfs;version="[5.3.3,5.4.0)", + org.eclipse.jgit.lib;version="[5.3.3,5.4.0)", + org.eclipse.jgit.merge;version="[5.3.3,5.4.0)", + org.eclipse.jgit.nls;version="[5.3.3,5.4.0)", + org.eclipse.jgit.notes;version="[5.3.3,5.4.0)", + org.eclipse.jgit.patch;version="[5.3.3,5.4.0)", + org.eclipse.jgit.pgm;version="[5.3.3,5.4.0)", + org.eclipse.jgit.pgm.internal;version="[5.3.3,5.4.0)", + org.eclipse.jgit.revplot;version="[5.3.3,5.4.0)", + org.eclipse.jgit.revwalk;version="[5.3.3,5.4.0)", + org.eclipse.jgit.revwalk.filter;version="[5.3.3,5.4.0)", + org.eclipse.jgit.storage.file;version="[5.3.3,5.4.0)", + org.eclipse.jgit.storage.pack;version="[5.3.3,5.4.0)", + org.eclipse.jgit.submodule;version="[5.3.3,5.4.0)", + org.eclipse.jgit.transport;version="[5.3.3,5.4.0)", + org.eclipse.jgit.transport.http;version="[5.3.3,5.4.0)", + org.eclipse.jgit.transport.resolver;version="[5.3.3,5.4.0)", + org.eclipse.jgit.treewalk;version="[5.3.3,5.4.0)", + org.eclipse.jgit.treewalk.filter;version="[5.3.3,5.4.0)", + org.eclipse.jgit.util;version="[5.3.3,5.4.0)", + org.eclipse.jgit.util.io;version="[5.3.3,5.4.0)", + org.eclipse.jgit.util.sha1;version="[5.3.3,5.4.0)", org.junit;version="[4.12,5.0.0)", org.junit.experimental.theories;version="[4.12,5.0.0)", org.junit.rules;version="[4.12,5.0.0)", @@@ -70,7 -77,8 +78,8 @@@ org.mockito.junit;version="[2.13.0,3.0.0)", org.mockito.stubbing;version="[2.13.0,3.0.0)", org.objenesis;version="[2.6.0,3.0.0)", - org.slf4j;version="[1.7.0,2.0.0)" + org.slf4j;version="[1.7.0,2.0.0)", + org.tukaani.xz;version="[1.6.0,2.0)" Require-Bundle: org.hamcrest.core;bundle-version="[1.1.0,2.0.0)", org.hamcrest.library;bundle-version="[1.1.0,2.0.0)" -Export-Package: org.eclipse.jgit.transport.ssh;version="5.2.3";x-friends:="org.eclipse.jgit.ssh.apache.test" +Export-Package: org.eclipse.jgit.transport.ssh;version="5.3.3";x-friends:="org.eclipse.jgit.ssh.apache.test" diff --cc org.eclipse.jgit.test/pom.xml index 21c06428f2,149663f64e..9f66d7ed73 --- a/org.eclipse.jgit.test/pom.xml +++ b/org.eclipse.jgit.test/pom.xml @@@ -144,8 -139,9 +150,9 @@@ org.apache.maven.plugins maven-surefire-plugin + ${maven-surefire-plugin-version} - -Djgit.test.long=true + @{argLine} -Djgit.test.long=true diff --cc org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java index cd96f41a42,a6072a0f5f..e4b7ed7ba7 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java @@@ -65,7 -61,7 +65,8 @@@ import org.eclipse.jgit.dircache.DirCac import org.eclipse.jgit.dircache.DirCacheBuilder; import org.eclipse.jgit.dircache.DirCacheEntry; import org.eclipse.jgit.junit.RepositoryTestCase; + import org.eclipse.jgit.junit.time.TimeUtil; +import org.eclipse.jgit.lib.CommitBuilder; import org.eclipse.jgit.lib.ConfigConstants; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.FileMode; diff --cc org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ObjectDirectoryTest.java index a3a302d81a,1d3ca03178..9d47c7e3bc --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ObjectDirectoryTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ObjectDirectoryTest.java @@@ -174,11 -176,13 +176,13 @@@ public class ObjectDirectoryTest extend } }); assertTrue(ret != null && ret.length == 1); - Assume.assumeTrue(tmpFile.lastModified() == ret[0].lastModified()); + FS fs = db.getFS(); + Assume.assumeTrue(fs.lastModifiedInstant(tmpFile) + .equals(fs.lastModifiedInstant(ret[0]))); // all objects are in a new packfile but we will not detect it - assertFalse(receivingDB.hasObject(unknownID)); - assertTrue(receivingDB.hasObject(id2)); + assertFalse(receivingDB.getObjectDatabase().has(unknownID)); + assertTrue(receivingDB.getObjectDatabase().has(id2)); } } diff --cc org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryTest.java index 7b3684c865,24e3bc0773..2357edf6cb --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryTest.java @@@ -60,9 -59,9 +60,10 @@@ import static org.junit.Assert.fail import java.io.File; import java.io.IOException; + import java.time.Instant; import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; @@@ -671,8 -645,9 +674,9 @@@ public class RefDirectoryTest extends L assertEquals(B, all.get(HEAD).getObjectId()); } + @Repeat(n = 100, abortOnFailure = false) @Test - public void testGetRef_DiscoversModifiedLoose() throws IOException { + public void testFindRef_DiscoversModifiedLoose() throws IOException { Map all; writeLooseRef("refs/heads/master", A); diff --cc org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java index 6f61912f2b,9a0e7d2eac..754341dfea --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java @@@ -52,8 -51,8 +52,9 @@@ import static org.junit.Assume.assumeNo import java.io.File; import java.io.IOException; +import java.nio.file.InvalidPathException; import java.security.MessageDigest; + import java.time.Instant; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.ResetCommand.ResetType; diff --cc org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FSTest.java index 6dfa6ef5aa,2054e1efa8..99d435100b --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FSTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FSTest.java @@@ -101,17 -101,16 +103,17 @@@ public class FSTest public void testSymlinkAttributes() throws IOException, InterruptedException { Assume.assumeTrue(FS.DETECTED.supportsSymlinks()); FS fs = FS.DETECTED; - File link = new File(trash, "ä"); - File target = new File(trash, "å"); - fs.createSymLink(link, "å"); + File link = new File(trash, "a"); + File target = new File(trash, "b"); + fs.createSymLink(link, "b"); assertTrue(fs.exists(link)); String targetName = fs.readSymLink(link); - assertEquals("å", targetName); + assertEquals("b", targetName); - assertTrue(fs.lastModified(link) > 0); + assertTrue(fs.lastModifiedInstant(link).compareTo(EPOCH) > 0); assertTrue(fs.exists(link)); assertFalse(fs.canExecute(link)); - assertEquals(2, fs.length(link)); + // The length of a symbolic link is a length of the target file path. + assertEquals(1, fs.length(link)); assertFalse(fs.exists(target)); assertFalse(fs.isFile(target)); assertFalse(fs.isDirectory(target)); diff --cc org.eclipse.jgit/.settings/.api_filters index eb93d3e2b0,2c9b3fe422..2d50e3a3b5 --- a/org.eclipse.jgit/.settings/.api_filters +++ b/org.eclipse.jgit/.settings/.api_filters @@@ -3,8 -3,8 +3,8 @@@ - - - ++ + @@@ -78,11 -126,93 +126,73 @@@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --cc org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java index 307fd3f310,8aa97df777..2d6228657a --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java @@@ -427,9 -426,11 +428,11 @@@ public class DirCacheCheckout // update the timestamp of the index with the one from the // file if not set, as we are sure to be in sync here. DirCacheEntry entry = i.getDirCacheEntry(); - if (entry.getLastModified() == 0) - entry.setLastModified(f.getEntryLastModified()); + Instant mtime = entry.getLastModifiedInstant(); + if (mtime == null || mtime.equals(Instant.EPOCH)) { + entry.setLastModified(f.getEntryLastModifiedInstant()); + } - keep(entry); + keep(entry, f); } } else // The index contains a folder diff --cc pom.xml index 48abd185e6,a7d8c8014b..275d1d634a --- a/pom.xml +++ b/pom.xml @@@ -193,21 -193,21 +193,23 @@@ 1.18 4.3.1 3.1.0 - 9.4.11.v20180605 + 9.4.14.v20181114 - 0.13.0 + 0.14.1 - 4.5.5 - 4.4.9 + 4.5.6 + 4.4.10 1.7.2 1.2.15 3.1.0 1.3.0 2.8.2 + 1.60 + 3.1.11 - 2.22.1 - 3.8.0 3.0.0 3.0.0 + 3.1.12 + 3.0.0-M3 + ${maven-surefire-plugin-version} + 3.8.1 jacoco @@@ -395,12 -394,26 +397,31 @@@ maven-project-info-reports-plugin ${maven-project-info-reports-plugin-version} - + + org.apache.maven.plugins + maven-deploy-plugin + 3.0.0-M1 + + + org.apache.maven.plugins + maven-install-plugin + 3.0.0-M1 + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin-version} + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.springframework.boot + spring-boot-maven-plugin + 2.1.2.RELEASE +