From 3f5f28b48754bc91620a6354ca70afe4c61c9894 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 9 Dec 2011 12:23:45 -0400 Subject: factor out a stopUnless code melt for lunch --- Command/Fix.hs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'Command/Fix.hs') 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 -- cgit v1.2.3