Looks good - the underlying code problem is that the check operation
works by replaying into pristine.hashed, so this patch moves to a
temporary directory to do that.
The test doesn't actually fail before the code change, because of a
missing -r in the diff call (at least on Windows). I'll push a tweak
along with this patch.