diff options
Diffstat (limited to 'Git/Destroyer.hs')
-rw-r--r-- | Git/Destroyer.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Git/Destroyer.hs b/Git/Destroyer.hs index 8827976..955e313 100644 --- a/Git/Destroyer.hs +++ b/Git/Destroyer.hs @@ -129,11 +129,10 @@ applyDamage ds r = do ScrambleFileMode s mode -> withfile s $ \f -> setFileMode f mode - SwapFiles a b - | a == b -> noop - | otherwise -> - withfile a $ \fa -> - withfile b $ \fb -> + SwapFiles a b -> + withfile a $ \fa -> + withfile b $ \fb -> + unless (fa == fb) $ withTmpFile "swap" $ \tmp _ -> do moveFile fa tmp moveFile fb fa |