summaryrefslogtreecommitdiff
path: root/Command/Add.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-01-06 17:34:44 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-01-06 17:34:44 -0400
commit61a5b85864301ffa6915326e674a83c36c74afe7 (patch)
tree22f823a092e5822920b4259785a83413c1867533 /Command/Add.hs
parent89c3bf6269500c454de3c07a002971f45788f8bf (diff)
addurl in direct mode
Diffstat (limited to 'Command/Add.hs')
-rw-r--r--Command/Add.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index 6d0ae2e1c..883be1b91 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -151,13 +151,14 @@ link file key hascontent = handle (undo file key) $ do
{- Note: Several other commands call this, and expect it to
- create the symlink and add it. -}
cleanup :: FilePath -> Key -> Bool -> CommandCleanup
-cleanup file key hascontent = ifM isDirect
+cleanup file key hascontent = ifM (isDirect <&&> pure hascontent)
( do
l <- calcGitLink file key
sha <- inRepo $ Git.HashObject.hashObject BlobObject l
Annex.Queue.addUpdateIndex =<<
inRepo (Git.UpdateIndex.stageSymlink file sha)
- logStatus key InfoPresent
+ when hascontent $
+ logStatus key InfoPresent
return True
, do
_ <- link file key hascontent