diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-01-09 13:11:56 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-01-09 13:11:56 -0400 |
commit | 425bc1107aebdb701cdcee44da731dd918cd470d (patch) | |
tree | 25bcacb37277b70aa7bd0caaf0fe7c3edc665653 /Command/Fsck.hs | |
parent | 20c7644a4d85434cf49840ea92fca0c723710c72 (diff) |
revert parentDir change
Reverts 2bba5bc22d049272d3328bfa6c452d3e2e50e86c
Unfortunately, this caused breakage on Windows, and possibly elsewhere,
because parentDir and takeDirectory do not behave the same when there is a
trailing directory separator.
Diffstat (limited to 'Command/Fsck.hs')
-rw-r--r-- | Command/Fsck.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs index 837e68ea8..46c1620f1 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -200,7 +200,7 @@ fixLink key file = do go want have | want /= fromInternalGitPath have = do showNote "fixing link" - liftIO $ createDirectoryIfMissing True (takeDirectory file) + liftIO $ createDirectoryIfMissing True (parentDir file) liftIO $ removeFile file addAnnexLink want file | otherwise = noop @@ -218,7 +218,7 @@ verifyLocationLog key desc = do file <- calcRepo $ gitAnnexLocation key when (present && not direct) $ freezeContent file - whenM (liftIO $ doesDirectoryExist $ takeDirectory file) $ + whenM (liftIO $ doesDirectoryExist $ parentDir file) $ freezeContentDir file {- In direct mode, modified files will show up as not present, @@ -450,7 +450,7 @@ needFsck _ _ = return True -} recordFsckTime :: Key -> Annex () recordFsckTime key = do - parent <- takeDirectory <$> calcRepo (gitAnnexLocation key) + parent <- parentDir <$> calcRepo (gitAnnexLocation key) liftIO $ void $ tryIO $ do touchFile parent #ifndef mingw32_HOST_OS @@ -459,7 +459,7 @@ recordFsckTime key = do getFsckTime :: Key -> Annex (Maybe EpochTime) getFsckTime key = do - parent <- takeDirectory <$> calcRepo (gitAnnexLocation key) + parent <- parentDir <$> calcRepo (gitAnnexLocation key) liftIO $ catchDefaultIO Nothing $ do s <- getFileStatus parent return $ if isSticky $ fileMode s @@ -477,7 +477,7 @@ getFsckTime key = do recordStartTime :: Annex () recordStartTime = do f <- fromRepo gitAnnexFsckState - createAnnexDirectory $ takeDirectory f + createAnnexDirectory $ parentDir f liftIO $ do nukeFile f withFile f WriteMode $ \h -> do |