unannex: Fix recently introduced bug when attempting to unannex more than one file at a time.
This commit is contained in:
parent
62ebeb00d9
commit
35a6506812
2 changed files with 10 additions and 5 deletions
|
@ -33,10 +33,13 @@ start file = isAnnexed file $ \(key, backend) -> do
|
||||||
ishere <- inAnnex key
|
ishere <- inAnnex key
|
||||||
if ishere
|
if ishere
|
||||||
then do
|
then do
|
||||||
g <- Annex.gitRepo
|
force <- Annex.getState Annex.force
|
||||||
staged <- liftIO $ Git.stagedFiles g [Git.workTree g]
|
unless force $ do
|
||||||
unless (null staged) $
|
g <- Annex.gitRepo
|
||||||
error "This command cannot be run when there are already files staged for commit."
|
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
|
showStart "unannex" file
|
||||||
return $ Just $ perform file key backend
|
return $ Just $ perform file key backend
|
||||||
|
@ -65,6 +68,6 @@ cleanup file key = do
|
||||||
-- Commit staged changes at end to avoid confusing the
|
-- Commit staged changes at end to avoid confusing the
|
||||||
-- pre-commit hook if this file is later added back to
|
-- pre-commit hook if this file is later added back to
|
||||||
-- git as a normal, non-annexed file.
|
-- 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
|
return True
|
||||||
|
|
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -1,6 +1,8 @@
|
||||||
git-annex (0.21) UNRELEASED; urgency=low
|
git-annex (0.21) UNRELEASED; urgency=low
|
||||||
|
|
||||||
* test: Don't rely on chmod -R working.
|
* 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
|
-- Joey Hess <joeyh@debian.org> Wed, 09 Feb 2011 00:12:11 -0400
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue