summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-11-27 17:07:22 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-11-27 17:07:22 -0400
commite0518a4adc250da1ad088c4362016627e1effb08 (patch)
treea48b3906567e4ccd2de647e656669829c0ec1686
parente97d13e29b18c4522395996299651334cb221519 (diff)
Fix bug in setkey subcommand triggered by move --to.
-rw-r--r--Command/SetKey.hs5
-rw-r--r--debian/changelog1
2 files changed, 5 insertions, 1 deletions
diff --git a/Command/SetKey.hs b/Command/SetKey.hs
index 685872f73..55472ccae 100644
--- a/Command/SetKey.hs
+++ b/Command/SetKey.hs
@@ -35,7 +35,10 @@ perform :: FilePath -> Key -> SubCmdPerform
perform file key = do
-- the file might be on a different filesystem, so mv is used
-- rather than simply calling moveToObjectDir key file
- ok <- getViaTmp key $ \dest -> liftIO $ boolSystem "mv" [file, dest]
+ ok <- getViaTmp key $ \dest -> do
+ if dest /= file
+ then liftIO $ boolSystem "mv" [file, dest]
+ else return True
if ok
then return $ Just $ cleanup key
else error "mv failed!"
diff --git a/debian/changelog b/debian/changelog
index 6e5e7ef48..75f4f9f0a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
git-annex (0.09) UNRELEASED; urgency=low
* Add copy subcommand.
+ * Fix bug in setkey subcommand triggered by move --to.
-- Joey Hess <joeyh@debian.org> Sat, 27 Nov 2010 16:58:33 -0400