optimise fsck --from normal git remotes
For a local git remote, can symlink the file. For a git remote using rsync, can preseed any local content. There are a few reasons to use fsck --from on a normal git remote. One is if it's using gitosis or similar, and you don't have shell access to run git annex locally. Another reason could be if you just want to fsck certian files of a bare remote.
This commit is contained in:
parent
f35a84fac7
commit
effaa298fa
3 changed files with 19 additions and 13 deletions
|
@ -199,12 +199,16 @@ dropKey r key
|
|||
|
||||
{- Tries to copy a key's content from a remote's annex to a file. -}
|
||||
copyFromRemote :: Git.Repo -> Key -> Bool -> FilePath -> Annex Bool
|
||||
copyFromRemote r key _ file
|
||||
copyFromRemote r key tmp file
|
||||
| not $ Git.repoIsUrl r = do
|
||||
params <- rsyncParams r
|
||||
loc <- liftIO $ gitAnnexLocation key r
|
||||
rsyncOrCopyFile params loc file
|
||||
| Git.repoIsSsh r = rsyncHelper =<< rsyncParamsRemote r True key file
|
||||
if tmp
|
||||
then liftIO $ catchBoolIO $ createSymbolicLink loc file >> return True
|
||||
else rsyncOrCopyFile params loc file
|
||||
| Git.repoIsSsh r = do
|
||||
when tmp $ Annex.Content.preseedTmp key file
|
||||
rsyncHelper =<< rsyncParamsRemote r True key file
|
||||
| Git.repoIsHttp r = Annex.Content.downloadUrl (keyUrls r key) file
|
||||
| otherwise = error "copying from non-ssh, non-http repo not supported"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue