aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-12-13 13:41:19 -0800
committerChris Aniszczyk <caniszczyk@gmail.com>2011-04-01 17:49:09 -0500
commitc261b28f677fdc755b86d16abebd2c30093514b4 (patch)
tree1ad00a68d59236a1a8f3231b12de2eefb3d89e92 /org.eclipse.jgit.test
parent58ed0cb840b29139483ce3b499354a6e5669498b (diff)
downloadjgit-c261b28f677fdc755b86d16abebd2c30093514b4.tar.gz
jgit-c261b28f677fdc755b86d16abebd2c30093514b4.zip
RefDirectory: Use FileSnapshot for packed-refs
Instead of tracking the length and modification time by hand, rely on FileSnapshot to tell RefDirectory when the $GIT_DIR/packed-refs file has been changed or should be re-read from disk. Change-Id: I067d268dfdca1d39c72dfa536b34e6a239117cc3 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RefDirectoryTest.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RefDirectoryTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RefDirectoryTest.java
index 2a13022326..a61580dd1f 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RefDirectoryTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RefDirectoryTest.java
@@ -1055,6 +1055,10 @@ public class RefDirectoryTest extends LocalDiskRepositoryTestCase {
private void writePackedRefs(String content) throws IOException {
File pr = new File(diskRepo.getDirectory(), "packed-refs");
write(pr, content);
+
+ final long now = System.currentTimeMillis();
+ final int oneHourAgo = 3600 * 1000;
+ pr.setLastModified(now - oneHourAgo);
}
private void deleteLooseRef(String name) {