summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java
index 108065913a..cd98539102 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java
@@ -80,6 +80,7 @@ import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.errors.ObjectWritingException;
import org.eclipse.jgit.events.RefsChangedEvent;
import org.eclipse.jgit.internal.JGitText;
+import org.eclipse.jgit.lib.ConfigConstants;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectIdRef;
@@ -765,14 +766,20 @@ public class RefDirectory extends RefDatabase {
}
private PackedRefList getPackedRefs() throws IOException {
+ boolean trustFolderStat = getRepository().getConfig().getBoolean(
+ ConfigConstants.CONFIG_CORE_SECTION,
+ ConfigConstants.CONFIG_KEY_TRUSTFOLDERSTAT, true);
+
final PackedRefList curList = packedRefs.get();
- if (!curList.snapshot.isModified(packedRefsFile))
+ if (trustFolderStat && !curList.snapshot.isModified(packedRefsFile)) {
return curList;
+ }
final PackedRefList newList = readPackedRefs();
if (packedRefs.compareAndSet(curList, newList)
- && !curList.id.equals(newList.id))
+ && !curList.id.equals(newList.id)) {
modCnt.incrementAndGet();
+ }
return newList;
}