summaryrefslogtreecommitdiff
path: root/Remote/Git.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-12-10 19:38:27 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-12-10 19:54:20 -0400
commitf44f715f51aad6cf164501b0d53b7163f3a5e758 (patch)
tree1810e08b0ff1edd23c4c2e62500e575b1c0272a9 /Remote/Git.hs
parent9ba99a544b79f9304839a5f4e756d8025e9f18f0 (diff)
ensure local remote is initialized when copying to it
Needed due to this scenario: Bare repo origin is made, foo is cloned from it; foo is initalized; a file is added to foo's annex; git annex move --to origin Since the git-annex branch has not yet been pushed to origin, it doesn't auto-initialize. When the content is sent to it, it's stored, but the remote has NoUUID, and so nothing is logged in the location log. Then the content is removed from the local repo, and git-annex has lost track of it. git annex fsck in origin will find the lost content, but let's not let this happen. Content should only be sent to initalized remotes. This cannot happen for non-local remotes, since git-annex-shell always checks that the repo is initialized.
Diffstat (limited to 'Remote/Git.hs')
-rw-r--r--Remote/Git.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs
index d172ec7c0..05743a28d 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -210,6 +210,7 @@ copyToRemote r key
params <- rsyncParams r
-- run copy from perspective of remote
liftIO $ onLocal r $ do
+ ensureInitialized
ok <- Annex.Content.getViaTmp key $
rsyncOrCopyFile params keysrc
Annex.Content.saveState