summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-03-03 15:22:53 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-03-03 15:22:53 -0400
commit9f20aee2192bcc5f2c0ae1f59db88f6eadeb7335 (patch)
treea35b490222a98f9f22ba65613ac9a051a8681ea7 /Command
parentd25a8540854fed30567868799322bbdf4e947c2f (diff)
avoid logging to location log when in a bare repo
This assumes that changes to content in bare repos are made from some non-bare repo, and that the location log is updated on that side. That's true for move --from and move --to. It's *not* true for dropkey and setkey and recvkey. But those are plumbing level commands, so I guess it's ok to assume that someone running those in a bare repo knows what they're doing. And git-annex-shell is used to run those, and if the bare repo is non-local, it needs to be able to use them even though they cannot update the location log. So this seems unavoidable.
Diffstat (limited to 'Command')
-rw-r--r--Command/Move.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Command/Move.hs b/Command/Move.hs
index 8c19539fb..3774ccbe9 100644
--- a/Command/Move.hs
+++ b/Command/Move.hs
@@ -51,6 +51,11 @@ showAction :: Bool -> FilePath -> Annex ()
showAction True file = showStart "move" file
showAction False file = showStart "copy" file
+{- Used to log a change in a remote's having a key. The change is logged
+ - in the local repo, not on the remote. The process of transferring the
+ - key to the remote, or removing the key from it *may* log the change
+ - on the remote, but this cannot be relied on. For example, it's not done
+ - for bare repos. -}
remoteHasKey :: Git.Repo -> Key -> Bool -> Annex ()
remoteHasKey remote key present = do
g <- Annex.gitRepo