summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-10-23 15:07:55 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-10-23 15:07:55 -0400
commit1bc7f989abe80f77c40dd84f485040b2fa5c5677 (patch)
tree9ed7f740dad9630f30232082bd38511e3cdd62d8
parent7a70e3f1454a4c83388e925925ff8fd9353e1c0e (diff)
make repair command deal with non-git-annex repos
-rw-r--r--Command/Repair.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/Command/Repair.hs b/Command/Repair.hs
index 6b1b5df4a..517e14afc 100644
--- a/Command/Repair.hs
+++ b/Command/Repair.hs
@@ -14,6 +14,7 @@ import qualified Git.Repair
import qualified Annex.Branch
import Git.Fsck (MissingObjects)
import Git.Types
+import Annex.Version
def :: [Command]
def = [noCommit $ dontCheck repoExists $
@@ -29,7 +30,10 @@ runRepair :: Bool -> Annex Bool
runRepair forced = do
(ok, stillmissing, modifiedbranches) <- inRepo $
Git.Repair.runRepair forced
- repairAnnexBranch stillmissing modifiedbranches
+ -- This command can be run in git repos not using git-annex,
+ -- so avoid git annex branch stuff in that case.
+ whenM (isJust <$> getVersion) $
+ repairAnnexBranch stillmissing modifiedbranches
return ok
{- After git repository repair, the .git/annex/index file could