aboutsummaryrefslogtreecommitdiff
path: root/Command/Fix.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-12-09 12:23:45 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-12-09 12:23:45 -0400
commit3f5f28b48754bc91620a6354ca70afe4c61c9894 (patch)
tree6c71b52187f442ce619ffac7c672fc7f0b8f84ce /Command/Fix.hs
parentd64132a43ae176e8a1353d5463c5387a93da9ad7 (diff)
factor out a stopUnless
code melt for lunch
Diffstat (limited to 'Command/Fix.hs')
-rw-r--r--Command/Fix.hs9
1 files changed, 3 insertions, 6 deletions
diff --git a/Command/Fix.hs b/Command/Fix.hs
index 27c4b167e..f264106c3 100644
--- a/Command/Fix.hs
+++ b/Command/Fix.hs
@@ -23,12 +23,9 @@ seek = [withFilesInGit $ whenAnnexed start]
start :: FilePath -> (Key, Backend Annex) -> CommandStart
start file (key, _) = do
link <- calcGitLink file key
- l <- liftIO $ readSymbolicLink file
- if link == l
- then stop
- else do
- showStart "fix" file
- next $ perform file link
+ stopUnless ((/=) link <$> liftIO (readSymbolicLink file)) $ do
+ showStart "fix" file
+ next $ perform file link
perform :: FilePath -> FilePath -> CommandPerform
perform file link = do