From 1bc7f989abe80f77c40dd84f485040b2fa5c5677 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 23 Oct 2013 15:07:55 -0400 Subject: make repair command deal with non-git-annex repos --- Command/Repair.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Command/Repair.hs') 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 -- cgit v1.2.3