don't stat until the file is written
Merge pull request #1438 from ethomson/checkout_stat

don't stat until the file is written