summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-16 22:43:38 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-16 22:43:38 -0400
commit96451ac392d42973f508da08d7c1197c83c659a6 (patch)
tree331eece8e1720eade2e6ae069e17382301f71543
parentda453ba70149444672b8cd64e36fe34604edce73 (diff)
nocommit does not make sense in unannex mode
-rw-r--r--Commands.hs14
1 files changed, 9 insertions, 5 deletions
diff --git a/Commands.hs b/Commands.hs
index 1364a1b35..be0a8e37f 100644
--- a/Commands.hs
+++ b/Commands.hs
@@ -122,11 +122,15 @@ addCmd file = inBackend file err $ do
{- Undo addCmd. -}
unannexCmd :: FilePath -> Annex ()
unannexCmd file = notinBackend file err $ \(key, backend) -> do
- Backend.removeKey backend key
- logStatus key ValueMissing
- g <- Annex.gitRepo
- let src = annexLocation g key
- liftIO $ moveout g src
+ nocommit <- Annex.flagIsSet NoCommit
+ if (nocommit)
+ then error "--nocommit cannot be used in unannex mode"
+ else do
+ Backend.removeKey backend key
+ logStatus key ValueMissing
+ g <- Annex.gitRepo
+ let src = annexLocation g key
+ liftIO $ moveout g src
where
err = error $ "not annexed " ++ file
moveout g src = do