Remotes can now be made read-only, by setting remote.<name>.annex-readonly

This commit is contained in:
Joey Hess 2014-01-02 13:12:32 -04:00
parent 7d5568485f
commit f7727d2df1
7 changed files with 45 additions and 3 deletions

View file

@ -203,7 +203,9 @@ pushRemote :: Remote -> Maybe Git.Ref -> CommandStart
pushRemote _remote Nothing = stop
pushRemote remote (Just branch) = go =<< needpush
where
needpush = anyM (newer remote) [syncBranch branch, Annex.Branch.name]
needpush
| remoteAnnexReadOnly (Types.Remote.gitconfig remote) = return False
| otherwise = anyM (newer remote) [syncBranch branch, Annex.Branch.name]
go False = stop
go True = do
showStart "push" (Remote.name remote)