summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-01-08 15:14:41 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-01-08 15:14:41 -0400
commit32b0e103909035ad0f25427c57a1ff504aefcada (patch)
tree92bcafa885e1c02795226c7c80c8174576e560ef /Command
parent82fe151f8796c5f0a37565134deb55142fdd1a99 (diff)
unannex: Now skips files whose content is not present, rather than it being an error. This allows gradual conversion from one backend to another by running unannex followed by add in each repository.
Diffstat (limited to 'Command')
-rw-r--r--Command/Unannex.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Command/Unannex.hs b/Command/Unannex.hs
index 288f9da44..2c60a23bb 100644
--- a/Command/Unannex.hs
+++ b/Command/Unannex.hs
@@ -29,8 +29,12 @@ seek = [withFilesInGit start]
{- The unannex subcommand undoes an add. -}
start :: CommandStartString
start file = isAnnexed file $ \(key, backend) -> do
- showStart "unannex" file
- return $ Just $ perform file key backend
+ ishere <- inAnnex key
+ if ishere
+ then do
+ showStart "unannex" file
+ return $ Just $ perform file key backend
+ else return Nothing
perform :: FilePath -> Key -> Backend -> CommandPerform
perform file key backend = do