diff options
author | 2010-11-22 17:51:55 -0400 | |
---|---|---|
committer | 2010-11-22 17:51:55 -0400 | |
commit | eeae91024285c85a7e77b1b44e501a63bced7154 (patch) | |
tree | ece6c1d1e670e04001dd570a375ed9954078da0a /Backend/SHA1.hs | |
parent | 57adb0347bf4eb71ab846a2947680a20263449a2 (diff) |
finished hlinting
Diffstat (limited to 'Backend/SHA1.hs')
-rw-r--r-- | Backend/SHA1.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Backend/SHA1.hs b/Backend/SHA1.hs index 46667c9cd..68f7f683b 100644 --- a/Backend/SHA1.hs +++ b/Backend/SHA1.hs @@ -33,15 +33,15 @@ sha1 file = do liftIO $ pOpen ReadFromPipe "sha1sum" [file] $ \h -> do line <- hGetLine h let bits = split " " line - if (null bits) + if null bits then error "sha1sum parse error" - else return $ bits !! 0 + else return $ head bits -- A key is a sha1 of its contents. keyValue :: FilePath -> Annex (Maybe Key) keyValue file = do s <- sha1 file - return $ Just $ Key ((name backend), s) + return $ Just $ Key (name backend, s) -- A key's sha1 is checked during fsck. checkKeySHA1 :: Key -> Annex Bool @@ -49,11 +49,11 @@ checkKeySHA1 key = do g <- Annex.gitRepo let file = annexLocation g key present <- liftIO $ doesFileExist file - if (not present) + if not present then return True else do s <- sha1 file - if (s == keyName key) + if s == keyName key then return True else do dest <- moveBad key |