|
|
@ -44,6 +44,10 @@ |
|
|
|
package org.eclipse.jgit.internal.storage.file; |
|
|
|
package org.eclipse.jgit.internal.storage.file; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.File; |
|
|
|
import java.io.File; |
|
|
|
|
|
|
|
import java.text.DateFormat; |
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
import java.util.Locale; |
|
|
|
|
|
|
|
|
|
|
|
import org.eclipse.jgit.util.FS; |
|
|
|
import org.eclipse.jgit.util.FS; |
|
|
|
|
|
|
|
|
|
|
@ -207,6 +211,18 @@ public class FileSnapshot { |
|
|
|
return (int) lastModified; |
|
|
|
return (int) lastModified; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public String toString() { |
|
|
|
|
|
|
|
if (this == DIRTY) |
|
|
|
|
|
|
|
return "DIRTY"; //$NON-NLS-1$
|
|
|
|
|
|
|
|
if (this == MISSING_FILE) |
|
|
|
|
|
|
|
return "MISSING_FILE"; //$NON-NLS-1$
|
|
|
|
|
|
|
|
DateFormat f = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", //$NON-NLS-1$
|
|
|
|
|
|
|
|
Locale.US); |
|
|
|
|
|
|
|
return "FileSnapshot[modified: " + f.format(new Date(lastModified)) //$NON-NLS-1$
|
|
|
|
|
|
|
|
+ ", read: " + f.format(new Date(lastRead)) + "]"; //$NON-NLS-1$ //$NON-NLS-2$
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private boolean notRacyClean(final long read) { |
|
|
|
private boolean notRacyClean(final long read) { |
|
|
|
// The last modified time granularity of FAT filesystems is 2 seconds.
|
|
|
|
// The last modified time granularity of FAT filesystems is 2 seconds.
|
|
|
|
// Using 2.5 seconds here provides a reasonably high assurance that
|
|
|
|
// Using 2.5 seconds here provides a reasonably high assurance that
|
|
|
|