From c261b28f677fdc755b86d16abebd2c30093514b4 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Mon, 13 Dec 2010 13:41:19 -0800 Subject: 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 --- .../tst/org/eclipse/jgit/storage/file/RefDirectoryTest.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'org.eclipse.jgit.test/tst/org') 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) { -- cgit v1.2.3