summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
Diffstat (limited to 'Command')
-rw-r--r--Command/Describe.hs2
-rw-r--r--Command/Fsck.hs8
-rw-r--r--Command/Init.hs5
-rw-r--r--Command/InitRemote.hs2
-rw-r--r--Command/Move.hs6
-rw-r--r--Command/Semitrust.hs2
-rw-r--r--Command/Trust.hs2
-rw-r--r--Command/Untrust.hs2
8 files changed, 15 insertions, 14 deletions
diff --git a/Command/Describe.hs b/Command/Describe.hs
index 2ad3e01ee..453e4ebaf 100644
--- a/Command/Describe.hs
+++ b/Command/Describe.hs
@@ -20,7 +20,7 @@ seek :: [CommandSeek]
seek = [withWords start]
start :: CommandStartWords
-start ws = notBareRepo $ do
+start ws = do
let (name, description) =
case ws of
(n:d) -> (n,unwords d)
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index 0e3df03dd..cb062342d 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -64,11 +64,11 @@ verifyLocationLog key file = do
case (present, u `elem` uuids) of
(True, False) -> do
- fix u ValuePresent
+ fix g u ValuePresent
-- There is no data loss, so do not fail.
return True
(False, True) -> do
- fix u ValueMissing
+ fix g u ValueMissing
warning $
"** Based on the location log, " ++ file
++ "\n** was expected to be present, " ++
@@ -77,6 +77,6 @@ verifyLocationLog key file = do
_ -> return True
where
- fix u s = do
+ fix g u s = do
showNote "fixing location log"
- logStatusFor u key s
+ logChange g key u s
diff --git a/Command/Init.hs b/Command/Init.hs
index df416eed3..7f5773117 100644
--- a/Command/Init.hs
+++ b/Command/Init.hs
@@ -8,7 +8,7 @@
module Command.Init where
import Control.Monad.State (liftIO)
-import Control.Monad (when)
+import Control.Monad (when, unless)
import System.Directory
import Command
@@ -44,7 +44,8 @@ perform description = do
u <- getUUID g
setVersion
describeUUID u description
- gitPreCommitHookWrite g
+ unless (Git.repoIsLocalBare g) $
+ gitPreCommitHookWrite g
next $ return True
{- set up a git pre-commit hook, if one is not already present -}
diff --git a/Command/InitRemote.hs b/Command/InitRemote.hs
index 67030689d..a3054630c 100644
--- a/Command/InitRemote.hs
+++ b/Command/InitRemote.hs
@@ -30,7 +30,7 @@ seek :: [CommandSeek]
seek = [withWords start]
start :: CommandStartWords
-start ws = notBareRepo $ do
+start ws = do
when (null ws) $ needname
(u, c) <- findByName name
diff --git a/Command/Move.hs b/Command/Move.hs
index f49fe20e0..7fa195bab 100644
--- a/Command/Move.hs
+++ b/Command/Move.hs
@@ -51,12 +51,12 @@ 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. -}
+ - on the remote, but this cannot be relied on. -}
remoteHasKey :: Remote.Remote Annex -> Key -> Bool -> Annex ()
remoteHasKey remote key present = do
let remoteuuid = Remote.uuid remote
- logStatusFor remoteuuid key status
+ g <- Annex.gitRepo
+ logChange g key remoteuuid status
where
status = if present then ValuePresent else ValueMissing
diff --git a/Command/Semitrust.hs b/Command/Semitrust.hs
index 11742137f..b467861bf 100644
--- a/Command/Semitrust.hs
+++ b/Command/Semitrust.hs
@@ -21,7 +21,7 @@ seek :: [CommandSeek]
seek = [withWords start]
start :: CommandStartWords
-start ws = notBareRepo $ do
+start ws = do
let name = unwords ws
showStart "semitrust" name
u <- Remote.nameToUUID name
diff --git a/Command/Trust.hs b/Command/Trust.hs
index d5444affe..41eb17ccd 100644
--- a/Command/Trust.hs
+++ b/Command/Trust.hs
@@ -21,7 +21,7 @@ seek :: [CommandSeek]
seek = [withWords start]
start :: CommandStartWords
-start ws = notBareRepo $ do
+start ws = do
let name = unwords ws
showStart "trust" name
u <- Remote.nameToUUID name
diff --git a/Command/Untrust.hs b/Command/Untrust.hs
index 174c39506..ea2320800 100644
--- a/Command/Untrust.hs
+++ b/Command/Untrust.hs
@@ -21,7 +21,7 @@ seek :: [CommandSeek]
seek = [withWords start]
start :: CommandStartWords
-start ws = notBareRepo $ do
+start ws = do
let name = unwords ws
showStart "untrust" name
u <- Remote.nameToUUID name