diff options
Diffstat (limited to 'org.eclipse.jgit')
5 files changed, 32 insertions, 4 deletions
diff --git a/org.eclipse.jgit/META-INF/MANIFEST.MF b/org.eclipse.jgit/META-INF/MANIFEST.MF index 91e905b2ff..6fb62b1583 100644 --- a/org.eclipse.jgit/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit/META-INF/MANIFEST.MF @@ -132,7 +132,8 @@ Export-Package: org.eclipse.jgit.annotations;version="6.1.0", org.eclipse.jgit.submodule, org.eclipse.jgit.util.time", org.eclipse.jgit.lib.internal;version="6.1.0"; - x-friends:="org.eclipse.jgit.test", + x-friends:="org.eclipse.jgit.test, + org.eclipse.jgit.pgm", org.eclipse.jgit.logging;version="6.1.0", org.eclipse.jgit.merge;version="6.1.0"; uses:="org.eclipse.jgit.dircache, diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java index 9cdea597f9..53a1cd6390 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java @@ -594,6 +594,7 @@ public class FileRepository extends Repository { } /** {@inheritDoc} */ + @SuppressWarnings("FutureReturnValueIgnored") @Override public void autoGC(ProgressMonitor monitor) { GC gc = new GC(this); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java index 78262e9773..d06b5a72d1 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java @@ -106,6 +106,8 @@ public class LockFile { private boolean written; + private boolean snapshotNoConfig; + private FileSnapshot commitSnapshot; private LockToken token; @@ -403,6 +405,21 @@ public class LockFile { } /** + * Request that {@link #commit()} remember the + * {@link org.eclipse.jgit.internal.storage.file.FileSnapshot} without using + * config file to get filesystem timestamp resolution. + * This method should be invoked before the file is accessed. + * It is used by FileBasedConfig to avoid endless recursion. + * + * @param on + * true if the commit method must remember the FileSnapshot. + */ + public void setNeedSnapshotNoConfig(boolean on) { + needSnapshot = on; + snapshotNoConfig = on; + } + + /** * Request that {@link #commit()} force dirty data to the drive. * * @param on @@ -480,8 +497,12 @@ public class LockFile { } private void saveStatInformation() { - if (needSnapshot) - commitSnapshot = FileSnapshot.save(lck); + if (needSnapshot) { + commitSnapshot = snapshotNoConfig ? + // don't use config in this snapshot to avoid endless recursion + FileSnapshot.saveNoConfig(lck) + : FileSnapshot.save(lck); + } } /** diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java index 0b9b981088..7b5f00e4fe 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java @@ -219,7 +219,7 @@ public class FileBasedConfig extends StoredConfig { if (!lf.lock()) throw new LockFailedException(getFile()); try { - lf.setNeedSnapshot(true); + lf.setNeedSnapshotNoConfig(true); lf.write(out); if (!lf.commit()) throw new IOException(MessageFormat.format(JGitText.get().cannotCommitWriteTo, getFile())); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java index 6da6c13342..0a7eb17f05 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java @@ -2175,6 +2175,11 @@ public class UploadPack { if (want.has(SATISFIED)) return true; + if (((RevCommit) want).getParentCount() == 0) { + want.add(SATISFIED); + return true; + } + walk.resetRetain(SAVE); walk.markStart((RevCommit) want); if (oldestTime != 0) |