diff options
author | Joey Hess <joey@kitenet.net> | 2011-02-09 11:02:21 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-02-09 11:02:21 -0400 |
commit | 35a65068123f0215929e06e98bf4a6a67d2ae7dd (patch) | |
tree | 45fe553d4d25f1ea69bf542514351c6dbd7f0a18 | |
parent | 62ebeb00d9f079f079c38798f8496dd666ae1fd5 (diff) |
unannex: Fix recently introduced bug when attempting to unannex more than one file at a time.
-rw-r--r-- | Command/Unannex.hs | 13 | ||||
-rw-r--r-- | debian/changelog | 2 |
2 files changed, 10 insertions, 5 deletions
diff --git a/Command/Unannex.hs b/Command/Unannex.hs index c663b29ab..19cb1624e 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 52a749178..072e5fc23 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 <joeyh@debian.org> Wed, 09 Feb 2011 00:12:11 -0400 |