Merge branch 'master' into git-remote-annex
This commit is contained in:
commit
468de43d66
4 changed files with 66 additions and 27 deletions
|
@ -26,7 +26,6 @@ import Types.Backend
|
||||||
import Types.KeySource
|
import Types.KeySource
|
||||||
import Utility.Hash
|
import Utility.Hash
|
||||||
import Utility.Metered
|
import Utility.Metered
|
||||||
import qualified Utility.RawFilePath as R
|
|
||||||
|
|
||||||
import qualified Data.ByteString as S
|
import qualified Data.ByteString as S
|
||||||
import qualified Data.ByteString.Short as S (toShort, fromShort)
|
import qualified Data.ByteString.Short as S (toShort, fromShort)
|
||||||
|
@ -129,14 +128,9 @@ keyValueE hash source meterupdate =
|
||||||
|
|
||||||
checkKeyChecksum :: (Key -> String -> Bool) -> Hash -> Key -> RawFilePath -> Annex Bool
|
checkKeyChecksum :: (Key -> String -> Bool) -> Hash -> Key -> RawFilePath -> Annex Bool
|
||||||
checkKeyChecksum issame hash key file = catchIOErrorType HardwareFault hwfault $ do
|
checkKeyChecksum issame hash key file = catchIOErrorType HardwareFault hwfault $ do
|
||||||
fast <- Annex.getRead Annex.fast
|
|
||||||
exists <- liftIO $ R.doesPathExist file
|
|
||||||
case (exists, fast) of
|
|
||||||
(True, False) -> do
|
|
||||||
showAction (UnquotedString descChecksum)
|
showAction (UnquotedString descChecksum)
|
||||||
issame key
|
issame key
|
||||||
<$> hashFile hash file nullMeterUpdate
|
<$> hashFile hash file nullMeterUpdate
|
||||||
_ -> return True
|
|
||||||
where
|
where
|
||||||
hwfault e = do
|
hwfault e = do
|
||||||
warning $ UnquotedString $ "hardware fault: " ++ show e
|
warning $ UnquotedString $ "hardware fault: " ++ show e
|
||||||
|
|
|
@ -3,6 +3,10 @@ git-annex (10.20240431) UNRELEASED; urgency=medium
|
||||||
* git-remote-annex: New program which allows pushing a git repo to a
|
* git-remote-annex: New program which allows pushing a git repo to a
|
||||||
git-annex special remote, and cloning from a special remote.
|
git-annex special remote, and cloning from a special remote.
|
||||||
(Based on Michael Hanke's git-remote-datalad-annex.)
|
(Based on Michael Hanke's git-remote-datalad-annex.)
|
||||||
|
* fsck: Fix recent reversion that made it say it was checksumming files
|
||||||
|
whose content is not present.
|
||||||
|
* Avoid the --fast option preventing checksumming in some cases it
|
||||||
|
was not supposed to.
|
||||||
* Typo fixes.
|
* Typo fixes.
|
||||||
Thanks, Yaroslav Halchenko
|
Thanks, Yaroslav Halchenko
|
||||||
|
|
||||||
|
|
|
@ -504,7 +504,8 @@ checkKeyUpgrade _ _ _ (AssociatedFile Nothing) =
|
||||||
checkBackend :: Key -> KeyStatus -> AssociatedFile -> Annex Bool
|
checkBackend :: Key -> KeyStatus -> AssociatedFile -> Annex Bool
|
||||||
checkBackend key keystatus afile = do
|
checkBackend key keystatus afile = do
|
||||||
content <- calcRepo (gitAnnexLocation key)
|
content <- calcRepo (gitAnnexLocation key)
|
||||||
ifM (pure (isKeyUnlockedThin keystatus) <&&> (not <$> isUnmodified key content))
|
ifM (liftIO $ R.doesPathExist content)
|
||||||
|
( ifM (pure (isKeyUnlockedThin keystatus) <&&> (not <$> isUnmodified key content))
|
||||||
( nocheck
|
( nocheck
|
||||||
, do
|
, do
|
||||||
mic <- withTSDelta (liftIO . genInodeCache content)
|
mic <- withTSDelta (liftIO . genInodeCache content)
|
||||||
|
@ -515,6 +516,8 @@ checkBackend key keystatus afile = do
|
||||||
, return False
|
, return False
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
, nocheck
|
||||||
|
)
|
||||||
where
|
where
|
||||||
nocheck = return True
|
nocheck = return True
|
||||||
|
|
||||||
|
@ -525,7 +528,10 @@ checkBackendRemote key remote ai localcopy =
|
||||||
checkBackendOr (badContentRemote remote localcopy) key localcopy ai
|
checkBackendOr (badContentRemote remote localcopy) key localcopy ai
|
||||||
|
|
||||||
checkBackendOr :: (Key -> Annex String) -> Key -> RawFilePath -> ActionItem -> Annex Bool
|
checkBackendOr :: (Key -> Annex String) -> Key -> RawFilePath -> ActionItem -> Annex Bool
|
||||||
checkBackendOr bad key file ai = do
|
checkBackendOr bad key file ai =
|
||||||
|
ifM (Annex.getRead Annex.fast)
|
||||||
|
( return True
|
||||||
|
, do
|
||||||
ok <- verifyKeyContent' key file
|
ok <- verifyKeyContent' key file
|
||||||
unless ok $ do
|
unless ok $ do
|
||||||
msg <- bad key
|
msg <- bad key
|
||||||
|
@ -533,6 +539,7 @@ checkBackendOr bad key file ai = do
|
||||||
<> ": Bad file content; "
|
<> ": Bad file content; "
|
||||||
<> UnquotedString msg
|
<> UnquotedString msg
|
||||||
return ok
|
return ok
|
||||||
|
)
|
||||||
|
|
||||||
{- Check, if there are InodeCaches recorded for a key, that one of them
|
{- Check, if there are InodeCaches recorded for a key, that one of them
|
||||||
- matches the object file. There are situations where the InodeCache
|
- matches the object file. There are situations where the InodeCache
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
It seems that performing `git annex adjust --unlock-present` or `sync`
|
||||||
|
will remove the +x permission from files.
|
||||||
|
|
||||||
|
Steps to reproduce:
|
||||||
|
|
||||||
|
$ mkdir /tmp/ga; cd /tmp/ga; git init ; git annex init
|
||||||
|
$ touch a.txt s.sh
|
||||||
|
$ chmod +x s.sh
|
||||||
|
$ git annex add . && git annex sync
|
||||||
|
$ stat -Lc%A s.sh
|
||||||
|
-r-xr-xr-x
|
||||||
|
$ git annex adjust --unlock-present
|
||||||
|
$ stat -c%A s.sh
|
||||||
|
-rw-r--r--
|
||||||
|
|
||||||
|
The permission is removed also after a sync, but only in case other
|
||||||
|
files have been changed (and adjust called behind the scenes):
|
||||||
|
|
||||||
|
$ chmod +x s.sh
|
||||||
|
$ git annex sync
|
||||||
|
$ stat -c%A s.sh
|
||||||
|
-rwxr-xr-x
|
||||||
|
$ git annex drop --force a.txt
|
||||||
|
$ stat -c%A s.sh
|
||||||
|
-rwxr-xr-x
|
||||||
|
$ git annex sync
|
||||||
|
$ stat -c%A s.sh
|
||||||
|
-rw-r--r--
|
||||||
|
|
||||||
|
I'm using git-annex version: 10.20240430-g5b36e6b4 with
|
||||||
|
annex.alwayscommit = false.
|
||||||
|
|
||||||
|
PS: git-annex is so solid that this is the first data-related issue I've
|
||||||
|
ever seen. Kudos!
|
Loading…
Reference in a new issue