direct: Avoid hardlinking symlinks that point to the same content when the content is not present.
This commit is contained in:
parent
82dbbfc0c3
commit
e457be7631
3 changed files with 12 additions and 2 deletions
|
@ -190,10 +190,13 @@ toDirectGen k f = do
|
||||||
liftIO $ replaceFile f $ moveFile loc
|
liftIO $ replaceFile f $ moveFile loc
|
||||||
, return Nothing
|
, return Nothing
|
||||||
)
|
)
|
||||||
(loc':_) -> return $ Just $ do
|
(loc':_) -> ifM (liftIO $ not . isSymbolicLink <$> getSymbolicLinkStatus f)
|
||||||
{- Another direct file has the content, so
|
{- Another direct file has the content, so
|
||||||
- hard link to it. -}
|
- hard link to it. -}
|
||||||
liftIO $ replaceFile f $ createLink loc'
|
( return $ Just $ do
|
||||||
|
liftIO $ replaceFile f $ createLink loc'
|
||||||
|
, return Nothing
|
||||||
|
)
|
||||||
|
|
||||||
{- Removes a direct mode file, while retaining its content. -}
|
{- Removes a direct mode file, while retaining its content. -}
|
||||||
removeDirect :: Key -> FilePath -> Annex ()
|
removeDirect :: Key -> FilePath -> Annex ()
|
||||||
|
|
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -7,6 +7,8 @@ git-annex (3.20130105) UNRELEASED; urgency=low
|
||||||
drop, log.
|
drop, log.
|
||||||
* assistant: Detect when system is not configured with a user name,
|
* assistant: Detect when system is not configured with a user name,
|
||||||
and set environment to prevent git from failing.
|
and set environment to prevent git from failing.
|
||||||
|
* direct: Avoid hardlinking symlinks that point to the same content
|
||||||
|
when the content is not present.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Thu, 03 Jan 2013 14:58:45 -0400
|
-- Joey Hess <joeyh@debian.org> Thu, 03 Jan 2013 14:58:45 -0400
|
||||||
|
|
||||||
|
|
|
@ -22,3 +22,8 @@ Running 3.20130102 on OSX
|
||||||
|
|
||||||
## Please provide any additional information below.
|
## Please provide any additional information below.
|
||||||
|
|
||||||
|
> More specifically, git annex direct fails, on OSX only, when there are two
|
||||||
|
> files that both have the same content. Apparently OSX doesn't allow
|
||||||
|
> hard linking two symbolic links together. There was no harm in it doing that
|
||||||
|
> otherwise, but then again no reason for it to do so, so I've put in a fix.
|
||||||
|
> [[done]] --[[Joey]]
|
||||||
|
|
Loading…
Add table
Reference in a new issue