diff options
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Unannex.hs | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/Command/Unannex.hs b/Command/Unannex.hs index c5ab028cd..0e691710a 100644 --- a/Command/Unannex.hs +++ b/Command/Unannex.hs @@ -49,14 +49,20 @@ cleanup file key = do void $ liftIO clean ifM (Annex.getState Annex.fast) - ( do - -- fast mode: hard link to content in annex - src <- inRepo $ gitAnnexLocation key - liftIO $ createLink src file - thawContent file - , do - fromAnnex key file - logStatus key InfoMissing + ( goFast + , go ) return True + where + goFast = do + -- fast mode: hard link to content in annex + src <- inRepo $ gitAnnexLocation key + -- creating a hard link could fall; fall back to non fast mode + ifM (liftIO $ catchBoolIO $ createLink src file >> return True) + ( thawContent file + , go + ) + go = do + fromAnnex key file + logStatus key InfoMissing |