Fix racy condition when a repository is repacked
If the filesystem clock granularity is sufficiently large enough it
is possible for a repacking program such as `git repack` to change
the same directory more than once within the same modification time.
If JGit were to scan the directory between changes in the same
clock step it will never see the later edits, because the directory
modification time has not changed.
Instead we now keep track of the last time we read the directory.
If an object cannot be found on disk and the pack directory's last
modified time is less than 2 minutes since the last time we read
the directory's contents, we scan it again looking for changes.
Worst case scenario, JGit will list the pack directory once for
each requested missing object, until the directory has aged at
least 2 minutes. Most repositories modify this directory only a
few times a week, so this is not an undue burden on the host.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>