Merge branch 'stable-5.10' into stable-5.11
* stable-5.10: Add missing @since tags Add missing @since tag Add missing @since tags Remove unused import in ApacheSshTest Update maven plugins Ignore missing javadoc in test bundles storage: file: De-duplicate File.exists()+File.isFile() RefDirectory.scanRef: Re-use file existence check done in snapshot creation FileSnapshot: Lazy load file store attributes cache Update eclipse-jarsigner-plugin to 1.3.2 Fix p2 repository URLs Change-Id: I84c73e11381c31566a12033db94e9afdcef5b705
This commit is contained in:
commit
e14b25f240
|
@ -125,6 +125,7 @@ public void setUploadPackFactory(UploadPackFactory<HttpServletRequest> f) {
|
||||||
*
|
*
|
||||||
* @param h
|
* @param h
|
||||||
* A custom error handler for git-upload-pack.
|
* A custom error handler for git-upload-pack.
|
||||||
|
* @since 5.6
|
||||||
*/
|
*/
|
||||||
public void setUploadPackErrorHandler(UploadPackErrorHandler h) {
|
public void setUploadPackErrorHandler(UploadPackErrorHandler h) {
|
||||||
assertNotInitialized();
|
assertNotInitialized();
|
||||||
|
@ -163,6 +164,7 @@ public void setReceivePackFactory(ReceivePackFactory<HttpServletRequest> f) {
|
||||||
*
|
*
|
||||||
* @param h
|
* @param h
|
||||||
* A custom error handler for git-receive-pack.
|
* A custom error handler for git-receive-pack.
|
||||||
|
* @since 5.7
|
||||||
*/
|
*/
|
||||||
public void setReceivePackErrorHandler(ReceivePackErrorHandler h) {
|
public void setReceivePackErrorHandler(ReceivePackErrorHandler h) {
|
||||||
assertNotInitialized();
|
assertNotInitialized();
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
* If a custom handler is not specified, JGit will use the default error
|
* If a custom handler is not specified, JGit will use the default error
|
||||||
* handler.
|
* handler.
|
||||||
*
|
*
|
||||||
* @since 5.6
|
* @since 5.7
|
||||||
*/
|
*/
|
||||||
public interface ReceivePackErrorHandler {
|
public interface ReceivePackErrorHandler {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -80,6 +80,7 @@ public String toString() {
|
||||||
* @param userGitConfig
|
* @param userGitConfig
|
||||||
* set another user-level git config
|
* set another user-level git config
|
||||||
* @return the old user-level git config
|
* @return the old user-level git config
|
||||||
|
* @since 5.1.9
|
||||||
*/
|
*/
|
||||||
public FileBasedConfig setUserGitConfig(FileBasedConfig userGitConfig) {
|
public FileBasedConfig setUserGitConfig(FileBasedConfig userGitConfig) {
|
||||||
FileBasedConfig old = this.userGitConfig;
|
FileBasedConfig old = this.userGitConfig;
|
||||||
|
@ -92,6 +93,7 @@ public FileBasedConfig setUserGitConfig(FileBasedConfig userGitConfig) {
|
||||||
*
|
*
|
||||||
* @param jgitConfig
|
* @param jgitConfig
|
||||||
* set the jgit configuration
|
* set the jgit configuration
|
||||||
|
* @since 5.5
|
||||||
*/
|
*/
|
||||||
public void setJGitConfig(FileBasedConfig jgitConfig) {
|
public void setJGitConfig(FileBasedConfig jgitConfig) {
|
||||||
this.jgitConfig = jgitConfig;
|
this.jgitConfig = jgitConfig;
|
||||||
|
@ -103,6 +105,7 @@ public void setJGitConfig(FileBasedConfig jgitConfig) {
|
||||||
* @param systemGitConfig
|
* @param systemGitConfig
|
||||||
* the new system-level git config
|
* the new system-level git config
|
||||||
* @return the old system-level config
|
* @return the old system-level config
|
||||||
|
* @since 5.1.9
|
||||||
*/
|
*/
|
||||||
public FileBasedConfig setSystemGitConfig(FileBasedConfig systemGitConfig) {
|
public FileBasedConfig setSystemGitConfig(FileBasedConfig systemGitConfig) {
|
||||||
FileBasedConfig old = this.systemGitConfig;
|
FileBasedConfig old = this.systemGitConfig;
|
||||||
|
|
|
@ -60,6 +60,7 @@ public static class RepeatedTestException extends RuntimeException {
|
||||||
*
|
*
|
||||||
* @param message
|
* @param message
|
||||||
* the error message
|
* the error message
|
||||||
|
* @since 5.1.9
|
||||||
*/
|
*/
|
||||||
public RepeatedTestException(String message) {
|
public RepeatedTestException(String message) {
|
||||||
super(message);
|
super(message);
|
||||||
|
|
|
@ -338,6 +338,7 @@ public static String slashify(String str) {
|
||||||
* greater than then the lastmodification time of lastfile.
|
* greater than then the lastmodification time of lastfile.
|
||||||
* @throws InterruptedException
|
* @throws InterruptedException
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
|
* @since 5.1.9
|
||||||
*/
|
*/
|
||||||
public static Instant fsTick(File lastFile)
|
public static Instant fsTick(File lastFile)
|
||||||
throws InterruptedException,
|
throws InterruptedException,
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
* This class is used when it's required to load jgit classes in separate
|
* This class is used when it's required to load jgit classes in separate
|
||||||
* classloader for each test class. It can be needed to isolate static field
|
* classloader for each test class. It can be needed to isolate static field
|
||||||
* initialization between separate tests.
|
* initialization between separate tests.
|
||||||
|
*
|
||||||
|
* @since 5.5
|
||||||
*/
|
*/
|
||||||
public class SeparateClassloaderTestRunner extends BlockJUnit4ClassRunner {
|
public class SeparateClassloaderTestRunner extends BlockJUnit4ClassRunner {
|
||||||
|
|
||||||
|
|
|
@ -339,6 +339,7 @@ public RevObject get(RevTree tree, String path)
|
||||||
* zero or more IDs of the commit's parents.
|
* zero or more IDs of the commit's parents.
|
||||||
* @return the ID of the new commit.
|
* @return the ID of the new commit.
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
|
* @since 5.5
|
||||||
*/
|
*/
|
||||||
public ObjectId unparsedCommit(ObjectId... parents) throws Exception {
|
public ObjectId unparsedCommit(ObjectId... parents) throws Exception {
|
||||||
return unparsedCommit(1, tree(), parents);
|
return unparsedCommit(1, tree(), parents);
|
||||||
|
@ -431,6 +432,7 @@ public RevCommit commit(final int secDelta, final RevTree tree,
|
||||||
* zero or more IDs of the commit's parents.
|
* zero or more IDs of the commit's parents.
|
||||||
* @return the ID of the new commit.
|
* @return the ID of the new commit.
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
|
* @since 5.5
|
||||||
*/
|
*/
|
||||||
public ObjectId unparsedCommit(final int secDelta, final RevTree tree,
|
public ObjectId unparsedCommit(final int secDelta, final RevTree tree,
|
||||||
final ObjectId... parents) throws Exception {
|
final ObjectId... parents) throws Exception {
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility methods for handling timestamps
|
* Utility methods for handling timestamps
|
||||||
|
*
|
||||||
|
* @since 5.1.9
|
||||||
*/
|
*/
|
||||||
public class TimeUtil {
|
public class TimeUtil {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?pde?>
|
<?pde?>
|
||||||
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
||||||
<target name="jgit-4.10" sequenceNumber="1635977193">
|
<target name="jgit-4.10" sequenceNumber="1638646045">
|
||||||
<locations>
|
<locations>
|
||||||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
||||||
|
|
|
@ -6,3 +6,4 @@ include "orbit/R20210223232630-2021-03.tpd"
|
||||||
location "https://download.eclipse.org/releases/2018-12/" {
|
location "https://download.eclipse.org/releases/2018-12/" {
|
||||||
org.eclipse.osgi lazy
|
org.eclipse.osgi lazy
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?pde?>
|
<?pde?>
|
||||||
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
||||||
<target name="jgit-4.11" sequenceNumber="1635977193">
|
<target name="jgit-4.11" sequenceNumber="1638646045">
|
||||||
<locations>
|
<locations>
|
||||||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?pde?>
|
<?pde?>
|
||||||
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
||||||
<target name="jgit-4.12" sequenceNumber="1635977193">
|
<target name="jgit-4.12" sequenceNumber="1638646045">
|
||||||
<locations>
|
<locations>
|
||||||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?pde?>
|
<?pde?>
|
||||||
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
||||||
<target name="jgit-4.13" sequenceNumber="1635977193">
|
<target name="jgit-4.13" sequenceNumber="1638646045">
|
||||||
<locations>
|
<locations>
|
||||||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?pde?>
|
<?pde?>
|
||||||
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
||||||
<target name="jgit-4.14" sequenceNumber="1635977193">
|
<target name="jgit-4.14" sequenceNumber="1638646045">
|
||||||
<locations>
|
<locations>
|
||||||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
||||||
|
|
|
@ -6,3 +6,4 @@ include "orbit/R20210223232630-2021-03.tpd"
|
||||||
location "https://download.eclipse.org/releases/2019-12/201912181000/" {
|
location "https://download.eclipse.org/releases/2019-12/201912181000/" {
|
||||||
org.eclipse.osgi lazy
|
org.eclipse.osgi lazy
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?pde?>
|
<?pde?>
|
||||||
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
||||||
<target name="jgit-4.15" sequenceNumber="1635977193">
|
<target name="jgit-4.15" sequenceNumber="1638646045">
|
||||||
<locations>
|
<locations>
|
||||||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?pde?>
|
<?pde?>
|
||||||
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
||||||
<target name="jgit-4.16" sequenceNumber="1635977193">
|
<target name="jgit-4.16" sequenceNumber="1638646045">
|
||||||
<locations>
|
<locations>
|
||||||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?pde?>
|
<?pde?>
|
||||||
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
||||||
<target name="jgit-4.17" sequenceNumber="1635977193">
|
<target name="jgit-4.17" sequenceNumber="1638646045">
|
||||||
<locations>
|
<locations>
|
||||||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?pde?>
|
<?pde?>
|
||||||
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
||||||
<target name="jgit-4.18" sequenceNumber="1635977193">
|
<target name="jgit-4.18" sequenceNumber="1638646045">
|
||||||
<locations>
|
<locations>
|
||||||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?pde?>
|
<?pde?>
|
||||||
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
||||||
<target name="jgit-4.19" sequenceNumber="1635977193">
|
<target name="jgit-4.19" sequenceNumber="1638646047">
|
||||||
<locations>
|
<locations>
|
||||||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?pde?>
|
<?pde?>
|
||||||
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
||||||
<target name="jgit-4.6" sequenceNumber="1635977193">
|
<target name="jgit-4.6" sequenceNumber="1638646045">
|
||||||
<locations>
|
<locations>
|
||||||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?pde?>
|
<?pde?>
|
||||||
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
||||||
<target name="jgit-4.7" sequenceNumber="1635977193">
|
<target name="jgit-4.7" sequenceNumber="1638646045">
|
||||||
<locations>
|
<locations>
|
||||||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?pde?>
|
<?pde?>
|
||||||
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
||||||
<target name="jgit-4.8" sequenceNumber="1635977193">
|
<target name="jgit-4.8" sequenceNumber="1638646045">
|
||||||
<locations>
|
<locations>
|
||||||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?pde?>
|
<?pde?>
|
||||||
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
|
||||||
<target name="jgit-4.9" sequenceNumber="1635977193">
|
<target name="jgit-4.9" sequenceNumber="1638646045">
|
||||||
<locations>
|
<locations>
|
||||||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
<unit id="org.eclipse.jetty.client" version="9.4.36.v20210114"/>
|
||||||
|
|
|
@ -186,6 +186,12 @@ public static FileSnapshot save(Instant modified) {
|
||||||
/** measured FileStore attributes */
|
/** measured FileStore attributes */
|
||||||
private FileStoreAttributes fileStoreAttributeCache;
|
private FileStoreAttributes fileStoreAttributeCache;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* if {@code true} read filesystem time resolution from configuration file
|
||||||
|
* otherwise use fallback resolution
|
||||||
|
*/
|
||||||
|
private boolean useConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Object that uniquely identifies the given file, or {@code
|
* Object that uniquely identifies the given file, or {@code
|
||||||
* null} if a file key is not available
|
* null} if a file key is not available
|
||||||
|
@ -222,9 +228,7 @@ protected FileSnapshot(File file) {
|
||||||
protected FileSnapshot(File file, boolean useConfig) {
|
protected FileSnapshot(File file, boolean useConfig) {
|
||||||
this.file = file;
|
this.file = file;
|
||||||
this.lastRead = Instant.now();
|
this.lastRead = Instant.now();
|
||||||
this.fileStoreAttributeCache = useConfig
|
this.useConfig = useConfig;
|
||||||
? FS.getFileStoreAttributes(file.toPath())
|
|
||||||
: FALLBACK_FILESTORE_ATTRIBUTES;
|
|
||||||
BasicFileAttributes fileAttributes = null;
|
BasicFileAttributes fileAttributes = null;
|
||||||
try {
|
try {
|
||||||
fileAttributes = FS.DETECTED.fileAttributes(file);
|
fileAttributes = FS.DETECTED.fileAttributes(file);
|
||||||
|
@ -379,7 +383,7 @@ public void setClean(FileSnapshot other) {
|
||||||
* if sleep was interrupted
|
* if sleep was interrupted
|
||||||
*/
|
*/
|
||||||
public void waitUntilNotRacy() throws InterruptedException {
|
public void waitUntilNotRacy() throws InterruptedException {
|
||||||
long timestampResolution = fileStoreAttributeCache
|
long timestampResolution = fileStoreAttributeCache()
|
||||||
.getFsTimestampResolution().toNanos();
|
.getFsTimestampResolution().toNanos();
|
||||||
while (isRacyClean(Instant.now())) {
|
while (isRacyClean(Instant.now())) {
|
||||||
TimeUnit.NANOSECONDS.sleep(timestampResolution);
|
TimeUnit.NANOSECONDS.sleep(timestampResolution);
|
||||||
|
@ -416,6 +420,15 @@ public boolean equals(Object obj) {
|
||||||
return equals(other);
|
return equals(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the file exists
|
||||||
|
*
|
||||||
|
* @return true if the file exists
|
||||||
|
*/
|
||||||
|
public boolean fileExists() {
|
||||||
|
return !MISSING_FILEKEY.equals(this.fileKey);
|
||||||
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
|
@ -500,10 +513,10 @@ private boolean isRacyClean(Instant read) {
|
||||||
}
|
}
|
||||||
|
|
||||||
private long getEffectiveRacyThreshold() {
|
private long getEffectiveRacyThreshold() {
|
||||||
long timestampResolution = fileStoreAttributeCache
|
long timestampResolution = fileStoreAttributeCache()
|
||||||
.getFsTimestampResolution().toNanos();
|
.getFsTimestampResolution().toNanos();
|
||||||
long minRacyInterval = fileStoreAttributeCache.getMinimalRacyInterval()
|
long minRacyInterval = fileStoreAttributeCache()
|
||||||
.toNanos();
|
.getMinimalRacyInterval().toNanos();
|
||||||
long max = Math.max(timestampResolution, minRacyInterval);
|
long max = Math.max(timestampResolution, minRacyInterval);
|
||||||
// safety margin: factor 2.5 below 100ms otherwise 1.25
|
// safety margin: factor 2.5 below 100ms otherwise 1.25
|
||||||
return max < 100_000_000L ? max * 5 / 2 : max * 5 / 4;
|
return max < 100_000_000L ? max * 5 / 2 : max * 5 / 4;
|
||||||
|
@ -563,4 +576,13 @@ private boolean isSizeChanged(long currSize) {
|
||||||
}
|
}
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private FileStoreAttributes fileStoreAttributeCache() {
|
||||||
|
if (fileStoreAttributeCache == null) {
|
||||||
|
fileStoreAttributeCache = useConfig
|
||||||
|
? FS.getFileStoreAttributes(file.toPath().getParent())
|
||||||
|
: FALLBACK_FILESTORE_ATTRIBUTES;
|
||||||
|
}
|
||||||
|
return fileStoreAttributeCache;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,7 +152,7 @@ public long getPackSize() {
|
||||||
String p = pack.getAbsolutePath();
|
String p = pack.getAbsolutePath();
|
||||||
String i = p.substring(0, p.length() - ".pack".length()) + ".idx"; //$NON-NLS-1$ //$NON-NLS-2$
|
String i = p.substring(0, p.length() - ".pack".length()) + ".idx"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
File idx = new File(i);
|
File idx = new File(i);
|
||||||
if (idx.exists() && idx.isFile())
|
if (idx.isFile())
|
||||||
size += idx.length();
|
size += idx.length();
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1092,10 +1092,14 @@ LooseRef scanRef(LooseRef ref, String name) throws IOException {
|
||||||
final int limit = 4096;
|
final int limit = 4096;
|
||||||
final byte[] buf;
|
final byte[] buf;
|
||||||
FileSnapshot otherSnapshot = FileSnapshot.save(path);
|
FileSnapshot otherSnapshot = FileSnapshot.save(path);
|
||||||
|
if (!otherSnapshot.fileExists()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
buf = IO.readSome(path, limit);
|
buf = IO.readSome(path, limit);
|
||||||
} catch (FileNotFoundException noFile) {
|
} catch (FileNotFoundException noFile) {
|
||||||
if (path.exists() && path.isFile()) {
|
if (path.isFile()) {
|
||||||
throw noFile;
|
throw noFile;
|
||||||
}
|
}
|
||||||
return null; // doesn't exist or no file; not a reference.
|
return null; // doesn't exist or no file; not a reference.
|
||||||
|
|
16
pom.xml
16
pom.xml
|
@ -168,13 +168,13 @@
|
||||||
<httpcore-version>4.4.14</httpcore-version>
|
<httpcore-version>4.4.14</httpcore-version>
|
||||||
<slf4j-version>1.7.30</slf4j-version>
|
<slf4j-version>1.7.30</slf4j-version>
|
||||||
<log4j-version>1.2.15</log4j-version>
|
<log4j-version>1.2.15</log4j-version>
|
||||||
<maven-javadoc-plugin-version>3.2.0</maven-javadoc-plugin-version>
|
<maven-javadoc-plugin-version>3.3.1</maven-javadoc-plugin-version>
|
||||||
<tycho-extras-version>1.7.0</tycho-extras-version>
|
<tycho-extras-version>1.7.0</tycho-extras-version>
|
||||||
<gson-version>2.8.6</gson-version>
|
<gson-version>2.8.6</gson-version>
|
||||||
<bouncycastle-version>1.65</bouncycastle-version>
|
<bouncycastle-version>1.65</bouncycastle-version>
|
||||||
<spotbugs-maven-plugin-version>4.2.0</spotbugs-maven-plugin-version>
|
<spotbugs-maven-plugin-version>4.3.0</spotbugs-maven-plugin-version>
|
||||||
<maven-project-info-reports-plugin-version>3.1.1</maven-project-info-reports-plugin-version>
|
<maven-project-info-reports-plugin-version>3.1.2</maven-project-info-reports-plugin-version>
|
||||||
<maven-jxr-plugin-version>3.0.0</maven-jxr-plugin-version>
|
<maven-jxr-plugin-version>3.1.1</maven-jxr-plugin-version>
|
||||||
<maven-surefire-plugin-version>3.0.0-M5</maven-surefire-plugin-version>
|
<maven-surefire-plugin-version>3.0.0-M5</maven-surefire-plugin-version>
|
||||||
<maven-surefire-report-plugin-version>${maven-surefire-plugin-version}</maven-surefire-report-plugin-version>
|
<maven-surefire-report-plugin-version>${maven-surefire-plugin-version}</maven-surefire-report-plugin-version>
|
||||||
<maven-compiler-plugin-version>3.8.1</maven-compiler-plugin-version>
|
<maven-compiler-plugin-version>3.8.1</maven-compiler-plugin-version>
|
||||||
|
@ -255,7 +255,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-dependency-plugin</artifactId>
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
<version>3.1.2</version>
|
<version>3.2.0</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
|
@ -307,7 +307,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-pmd-plugin</artifactId>
|
<artifactId>maven-pmd-plugin</artifactId>
|
||||||
<version>3.14.0</version>
|
<version>3.15.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<sourceEncoding>utf-8</sourceEncoding>
|
<sourceEncoding>utf-8</sourceEncoding>
|
||||||
<minimumTokens>100</minimumTokens>
|
<minimumTokens>100</minimumTokens>
|
||||||
|
@ -345,7 +345,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.jacoco</groupId>
|
<groupId>org.jacoco</groupId>
|
||||||
<artifactId>jacoco-maven-plugin</artifactId>
|
<artifactId>jacoco-maven-plugin</artifactId>
|
||||||
<version>0.8.6</version>
|
<version>0.8.7</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
@ -411,7 +411,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-enforcer-plugin</artifactId>
|
<artifactId>maven-enforcer-plugin</artifactId>
|
||||||
<version>3.0.0-M3</version>
|
<version>3.0.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>enforce-maven</id>
|
<id>enforce-maven</id>
|
||||||
|
|
Loading…
Reference in New Issue