From c7e67aa29183c7fe7bb14b909cf953a89c531b08 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 20 Jan 2015 16:58:48 -0400 Subject: add getFileSize, which can get the real size of a large file on Windows Avoid using fileSize which maxes out at just 2 gb on Windows. Instead, use hFileSize, which doesn't have a bounded size. Fixes support for files > 2 gb on Windows. Note that the InodeCache code only needs to compare a file size, so it doesn't matter it the file size wraps. So it has been left as-is. This was necessary both to avoid invalidating existing inode caches, and because the code passed FileStatus around and would have become more expensive if it called getFileSize. This commit was sponsored by Christian Dietrich. --- Remote/Git.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Remote/Git.hs') diff --git a/Remote/Git.hs b/Remote/Git.hs index f015e295e..583e9c728 100644 --- a/Remote/Git.hs +++ b/Remote/Git.hs @@ -563,9 +563,7 @@ rsyncOrCopyFile rsyncparams src dest p = (const $ copyFileExternal CopyTimeStamps src dest) watchfilesize oldsz = do threadDelay 500000 -- 0.5 seconds - v <- catchMaybeIO $ - toBytesProcessed . fileSize - <$> getFileStatus dest + v <- catchMaybeIO $ toBytesProcessed <$> getFileSize dest case v of Just sz | sz /= oldsz -> do -- cgit v1.2.3