nocommit does not make sense in unannex mode

This commit is contained in:
Joey Hess 2010-10-16 22:43:38 -04:00
parent da453ba701
commit 96451ac392

View file

@ -122,11 +122,15 @@ addCmd file = inBackend file err $ do
{- Undo addCmd. -} {- Undo addCmd. -}
unannexCmd :: FilePath -> Annex () unannexCmd :: FilePath -> Annex ()
unannexCmd file = notinBackend file err $ \(key, backend) -> do unannexCmd file = notinBackend file err $ \(key, backend) -> do
Backend.removeKey backend key nocommit <- Annex.flagIsSet NoCommit
logStatus key ValueMissing if (nocommit)
g <- Annex.gitRepo then error "--nocommit cannot be used in unannex mode"
let src = annexLocation g key else do
liftIO $ moveout g src Backend.removeKey backend key
logStatus key ValueMissing
g <- Annex.gitRepo
let src = annexLocation g key
liftIO $ moveout g src
where where
err = error $ "not annexed " ++ file err = error $ "not annexed " ++ file
moveout g src = do moveout g src = do