diff --git a/Command/Unannex.hs b/Command/Unannex.hs index c663b29ab0..19cb1624e5 100644 --- a/Command/Unannex.hs +++ b/Command/Unannex.hs @@ -33,10 +33,13 @@ start file = isAnnexed file $ \(key, backend) -> do ishere <- inAnnex key if ishere then do - g <- Annex.gitRepo - staged <- liftIO $ Git.stagedFiles g [Git.workTree g] - unless (null staged) $ - error "This command cannot be run when there are already files staged for commit." + force <- Annex.getState Annex.force + unless force $ do + g <- Annex.gitRepo + staged <- liftIO $ Git.stagedFiles g [Git.workTree g] + unless (null staged) $ + error "This command cannot be run when there are already files staged for commit." + Annex.changeState $ \s -> s { Annex.force = True } showStart "unannex" file return $ Just $ perform file key backend @@ -65,6 +68,6 @@ cleanup file key = do -- Commit staged changes at end to avoid confusing the -- pre-commit hook if this file is later added back to -- git as a normal, non-annexed file. - Annex.queue "commit" ["-m", "content removed from git annex"] "--" + Annex.queue "commit" ["-m", "content removed from git annex"] "-a" return True diff --git a/debian/changelog b/debian/changelog index 52a749178f..072e5fc232 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ git-annex (0.21) UNRELEASED; urgency=low * test: Don't rely on chmod -R working. + * unannex: Fix recently introduced bug when attempting to unannex more + than one file at a time. -- Joey Hess Wed, 09 Feb 2011 00:12:11 -0400