nocommit does not make sense in unannex mode
This commit is contained in:
parent
da453ba701
commit
96451ac392
1 changed files with 9 additions and 5 deletions
14
Commands.hs
14
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue