diff options
author | Joey Hess <joey@kitenet.net> | 2013-12-10 16:17:49 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-12-10 16:17:49 -0400 |
commit | 00219b1ff5e8d76a64016f4fc5d7641b33bfaf72 (patch) | |
tree | d9cce04630127f1a13d61c54a08fb8fbba1c91a0 /Command/Repair.hs | |
parent | e67eccd6e9b9b25873237c18e959a0604afb62e3 (diff) |
repair: Remove damaged git-annex sync branches.
Diffstat (limited to 'Command/Repair.hs')
-rw-r--r-- | Command/Repair.hs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Command/Repair.hs b/Command/Repair.hs index 0cd92268b..6b45ad6a8 100644 --- a/Command/Repair.hs +++ b/Command/Repair.hs @@ -28,7 +28,7 @@ start = next $ next $ runRepair =<< Annex.getState Annex.force runRepair :: Bool -> Annex Bool runRepair forced = do (ok, modifiedbranches) <- inRepo $ - Git.Repair.runRepair forced + Git.Repair.runRepair isAnnexSyncBranch forced -- This command can be run in git repos not using git-annex, -- so avoid git annex branch stuff in that case. whenM (isJust <$> getVersion) $ @@ -67,3 +67,9 @@ repairAnnexBranch modifiedbranches Annex.Branch.forceCommit "committing index after git repository repair" liftIO $ putStrLn "Successfully recovered the git-annex branch using .git/annex/index" nukeindex = inRepo $ nukeFile . gitAnnexIndex + +trackingOrSyncBranch :: Ref -> Bool +trackingOrSyncBranch b = Git.Repair.isTrackingBranch b || isAnnexSyncBranch b + +isAnnexSyncBranch :: Ref -> Bool +isAnnexSyncBranch b = "refs/synced/" `isPrefixOf` show b |