copy: avoid updating location log when no copy is performed

git annex copy --to remote often does not need to copy a file,
but it was still updating the location log in this case.
This commit is contained in:
Joey Hess 2012-09-24 19:58:34 -04:00
parent 72b14ec998
commit 40df26757a
2 changed files with 11 additions and 4 deletions

View file

@ -92,15 +92,16 @@ toPerform dest move key file = moveLock move key $ do
ok <- upload (Remote.uuid dest) key (Just file) noRetry $
Remote.storeKey dest key (Just file)
if ok
then finish
then finish True
else do
when fastcheck $
warning "This could have failed because --fast is enabled."
stop
Right True -> finish
Right True -> finish False
where
finish = do
Remote.logStatus dest key InfoPresent
finish remotechanged = do
when remotechanged $
Remote.logStatus dest key InfoPresent
if move
then do
whenM (inAnnex key) $ removeAnnex key

6
debian/changelog vendored
View file

@ -1,3 +1,9 @@
git-annex (3.20120925) UNRELEASED; urgency=low
* copy: Avoid updating the location log when no copy is performed.
-- Joey Hess <joeyh@debian.org> Mon, 24 Sep 2012 19:58:07 -0400
git-annex (3.20120924) unstable; urgency=low
* assistant: New command, a daemon which does everything watch does,