make repair command deal with non-git-annex repos
This commit is contained in:
parent
e32b62b50e
commit
66f0fb1a7f
1 changed files with 5 additions and 1 deletions
|
@ -14,6 +14,7 @@ import qualified Git.Repair
|
||||||
import qualified Annex.Branch
|
import qualified Annex.Branch
|
||||||
import Git.Fsck (MissingObjects)
|
import Git.Fsck (MissingObjects)
|
||||||
import Git.Types
|
import Git.Types
|
||||||
|
import Annex.Version
|
||||||
|
|
||||||
def :: [Command]
|
def :: [Command]
|
||||||
def = [noCommit $ dontCheck repoExists $
|
def = [noCommit $ dontCheck repoExists $
|
||||||
|
@ -29,7 +30,10 @@ runRepair :: Bool -> Annex Bool
|
||||||
runRepair forced = do
|
runRepair forced = do
|
||||||
(ok, stillmissing, modifiedbranches) <- inRepo $
|
(ok, stillmissing, modifiedbranches) <- inRepo $
|
||||||
Git.Repair.runRepair forced
|
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
|
return ok
|
||||||
|
|
||||||
{- After git repository repair, the .git/annex/index file could
|
{- After git repository repair, the .git/annex/index file could
|
||||||
|
|
Loading…
Add table
Reference in a new issue