From f2a4db724ceb5148ec32dd379f30fbd1db2f8c9c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 25 Oct 2018 14:31:45 -0400 Subject: [PATCH] remove redundant test populatePointerFile checks the same thing --- Command/Smudge.hs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Command/Smudge.hs b/Command/Smudge.hs index 28dc551d35..75dc6a17bb 100644 --- a/Command/Smudge.hs +++ b/Command/Smudge.hs @@ -144,11 +144,10 @@ emitPointer = putStr . formatPointer -- the pointer copy. It will then be populated with the content. getMoveRaceRecovery :: Key -> FilePath -> Annex () getMoveRaceRecovery k file = void $ tryNonAsync $ - liftIO (isPointerFile file) >>= \k' -> when (Just k == k') $ - whenM (inAnnex k) $ do - obj <- calcRepo (gitAnnexLocation k) - -- Cannot restage because git add is running and has - -- the index locked. - populatePointerFile (Restage False) k obj file >>= \case - Nothing -> return () - Just ic -> Database.Keys.addInodeCaches k [ic] + whenM (inAnnex k) $ do + obj <- calcRepo (gitAnnexLocation k) + -- Cannot restage because git add is running and has + -- the index locked. + populatePointerFile (Restage False) k obj file >>= \case + Nothing -> return () + Just ic -> Database.Keys.addInodeCaches k [ic]