Skip to content

Commit

Permalink
Trying to make GitSharp consistent with how modified files/directorie…
Browse files Browse the repository at this point in the history
…s checking is being performed.
  • Loading branch information
nulltoken committed Oct 8, 2009
1 parent 12fc9d7 commit c658dfc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Core/DirectoryCache/DirCache.cs
Expand Up @@ -319,7 +319,7 @@ public void read()
{
clear();
}
else if (_liveFile.LastAccessTime != _lastModified)
else if (_liveFile.LastWriteTime != _lastModified)
{
try
{
Expand Down Expand Up @@ -397,7 +397,7 @@ private void ReadFrom(Stream inStream)
{
_sortedEntries[i] = new DirCacheEntry(infos, i * InfoLen, inStream, md);
}
_lastModified = _liveFile.LastAccessTime;
_lastModified = _liveFile.LastWriteTime;

// After the file entries are index extensions, and then a footer.
//
Expand Down
2 changes: 1 addition & 1 deletion Core/PackFile.cs
Expand Up @@ -89,7 +89,7 @@ public PackFile(FileInfo idxFile, FileInfo packFile)
_packFile = packFile;

// [henon] why the heck right shift by 10 ?? ... seems to have to do with the SORT comparison
_packLastModified = (int)(packFile.LastAccessTime.Ticks >> 10);
_packLastModified = (int)(packFile.LastWriteTime.Ticks >> 10);

// Multiply by 31 here so we can more directly combine with another
// value in WindowCache.hash(), without doing the multiply there.
Expand Down
8 changes: 4 additions & 4 deletions Tests/ConcurrentRepackTest.cs
Expand Up @@ -204,7 +204,7 @@ private FileInfo[] Pack(Core.Repository src, params RevObject[] list)
private static void Write(FileInfo[] files, PackWriter pw)
{
FileInfo file = files[0];
long begin = file.Directory.LastAccessTime.Ticks;
long begin = file.Directory.LastWriteTime.Ticks;

using (var stream = file.Create())
{
Expand All @@ -226,7 +226,7 @@ private static void Write(FileInfo[] files, PackWriter pw)

private static void Delete(FileInfo[] list)
{
long begin = list[0].Directory.LastAccessTime.Ticks;
long begin = list[0].Directory.LastWriteTime.Ticks;
foreach (var fi in list)
{
fi.Delete();
Expand All @@ -238,10 +238,10 @@ private static void Delete(FileInfo[] list)

private static void Touch(long begin, FileSystemInfo dir)
{
while (begin >= dir.LastAccessTime.Ticks)
while (begin >= dir.LastWriteTime.Ticks)
{
Thread.Sleep(25);
dir.LastAccessTime = DateTime.Now;
dir.LastWriteTime = DateTime.Now;
}
}

Expand Down

0 comments on commit c658dfc

Please sign in to comment.