summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Command/Move.hs5
-rw-r--r--Content.hs16
2 files changed, 16 insertions, 5 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
diff --git a/Content.hs b/Content.hs
index 658d9a861..6b8316c08 100644
--- a/Content.hs
+++ b/Content.hs
@@ -23,7 +23,7 @@ import System.IO.Error (try)
import System.Directory
import Control.Monad.State (liftIO)
import System.Path
-import Control.Monad (when, filterM)
+import Control.Monad (when, unless, filterM)
import System.Posix.Files
import System.FilePath
@@ -54,13 +54,19 @@ calcGitLink file key = do
return $ relPathDirToDir (parentDir absfile)
(Git.workTree g) </> ".git" </> annexLocation key
-{- Updates the LocationLog when a key's presence changes. -}
+{- Updates the LocationLog when a key's presence changes.
+ -
+ - Note that the LocationLog is not updated in bare repositories.
+ - Operations that change a bare repository should be done from
+ - a non-bare repository, and the LocationLog in that repository be
+ - updated instead. -}
logStatus :: Key -> LogStatus -> Annex ()
logStatus key status = do
g <- Annex.gitRepo
- u <- getUUID g
- logfile <- liftIO $ logChange g key u status
- Annex.queue "add" [Param "--"] logfile
+ unless (Git.repoIsLocalBare g) $ do
+ u <- getUUID g
+ logfile <- liftIO $ logChange g key u status
+ Annex.queue "add" [Param "--"] logfile
{- Runs an action, passing it a temporary filename to download,
- and if the action succeeds, moves the temp file into