diff options
Diffstat (limited to 'Command/Uninit.hs')
-rw-r--r-- | Command/Uninit.hs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Command/Uninit.hs b/Command/Uninit.hs index 8214c4208..60e86cc03 100644 --- a/Command/Uninit.hs +++ b/Command/Uninit.hs @@ -19,18 +19,15 @@ import qualified Annex.Branch import Annex.Content command :: [Command] -command = [repoCommand "uninit" paramPaths seek +command = [Command "uninit" paramPaths check seek "de-initialize git-annex and clean out repository"] -seek :: [CommandSeek] -seek = [withNothing startCheck, withFilesInGit startUnannex, withNothing start] - -startCheck :: CommandStart -startCheck = do +check :: Annex () +check = do + needsRepo b <- current_branch when (b == Annex.Branch.name) $ error $ "cannot uninit when the " ++ b ++ " branch is checked out" - stop where current_branch = do g <- gitRepo @@ -38,6 +35,9 @@ startCheck = do Git.pipeRead g [Params "rev-parse --abbrev-ref HEAD"] return $ head $ lines $ B.unpack b +seek :: [CommandSeek] +seek = [withFilesInGit startUnannex, withNothing start] + startUnannex :: FilePath -> CommandStart startUnannex file = do -- Force fast mode before running unannex. This way, if multiple |