From 434a8098037574ddd83e09bbf82a9d5b27181b8e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 2 Jan 2014 13:12:32 -0400 Subject: Remotes can now be made read-only, by setting remote..annex-readonly --- Command/Sync.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Command') diff --git a/Command/Sync.hs b/Command/Sync.hs index 14c79e99d..38a6a5c6a 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -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) -- cgit v1.2.3