avoid accidentally thawing git-annex symlink
It did nothing, since at this point the link is dangling. But when there is a thaw hook, it would probably not be happy to be asked to run on a symlink, or might do something unexpected. Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
parent
f4b046252a
commit
51c528980c
3 changed files with 22 additions and 9 deletions
|
@ -631,15 +631,16 @@ removeAnnex (ContentRemovalLock key) = withObjectLoc key $ \file ->
|
||||||
where
|
where
|
||||||
-- Check associated pointer file for modifications, and reset if
|
-- Check associated pointer file for modifications, and reset if
|
||||||
-- it's unmodified.
|
-- it's unmodified.
|
||||||
resetpointer file = ifM (isUnmodified key file)
|
resetpointer file = unlessM (liftIO $ isSymbolicLink <$> getSymbolicLinkStatus (fromRawFilePath file)) $
|
||||||
( adjustedBranchRefresh (AssociatedFile (Just file)) $
|
ifM (isUnmodified key file)
|
||||||
depopulatePointerFile key file
|
( adjustedBranchRefresh (AssociatedFile (Just file)) $
|
||||||
-- Modified file, so leave it alone.
|
depopulatePointerFile key file
|
||||||
-- If it was a hard link to the annex object,
|
-- Modified file, so leave it alone.
|
||||||
-- that object might have been frozen as part of the
|
-- If it was a hard link to the annex object,
|
||||||
-- removal process, so thaw it.
|
-- that object might have been frozen as part of the
|
||||||
, void $ tryIO $ thawContent file
|
-- removal process, so thaw it.
|
||||||
)
|
, void $ tryIO $ thawContent file
|
||||||
|
)
|
||||||
|
|
||||||
{- Moves a key out of .git/annex/objects/ into .git/annex/bad, and
|
{- Moves a key out of .git/annex/objects/ into .git/annex/bad, and
|
||||||
- returns the file it was moved to. -}
|
- returns the file it was moved to. -}
|
||||||
|
|
|
@ -175,3 +175,5 @@ filing as a bug since I think I satisfied all desires of git-annex for ensuring
|
||||||
|
|
||||||
|
|
||||||
edit 1: I thought that may be "Locking down a directory only needs to do the equivilant of removing its write bit, does not need to lockdown the files within it." from [lockdown_hooks](https://git-annex.branchable.com/todo/lockdown_hooks/) does not really "work", so I added `-R` to above nfs4_facl calls, but seems the effect is the same -- annex doesn' like me :-/
|
edit 1: I thought that may be "Locking down a directory only needs to do the equivilant of removing its write bit, does not need to lockdown the files within it." from [lockdown_hooks](https://git-annex.branchable.com/todo/lockdown_hooks/) does not really "work", so I added `-R` to above nfs4_facl calls, but seems the effect is the same -- annex doesn' like me :-/
|
||||||
|
|
||||||
|
> [[fixed|done]] --[[Joey]]
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
[[!comment format=mdwn
|
||||||
|
username="joey"
|
||||||
|
subject="""comment 7"""
|
||||||
|
date="2022-02-24T18:13:20Z"
|
||||||
|
content="""
|
||||||
|
[2022-02-24 13:50:11.885644532] (Annex.Perms) thawing content ./foo
|
||||||
|
|
||||||
|
This turns out to be due to removeAnnex's resetpointer.
|
||||||
|
It was not intended to run on symlinks. I've fixed this too.
|
||||||
|
"""]]
|
Loading…
Add table
Add a link
Reference in a new issue