summaryrefslogtreecommitdiff
path: root/Command/Add.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-06-19 02:40:21 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-06-19 02:40:21 -0400
commit57cf65eb6d811ba7fd19eb62a54e3b83a0c2dfa7 (patch)
tree7711cef2d303fc485185f636c0e364e4f9cee0c5 /Command/Add.hs
parent4ab9449cee0cb1377a768b44fe832282ac1f88b9 (diff)
fix kevent symlink creation
Diffstat (limited to 'Command/Add.hs')
-rw-r--r--Command/Add.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index 7a6696063..43f186fbf 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -97,8 +97,8 @@ undo file key e = do
src <- inRepo $ gitAnnexLocation key
liftIO $ moveFile src file
-{- Creates the symlink to the annexed content. -}
-link :: FilePath -> Key -> Bool -> Annex ()
+{- Creates the symlink to the annexed content, returns the link target. -}
+link :: FilePath -> Key -> Bool -> Annex String
link file key hascontent = handle (undo file key) $ do
l <- calcGitLink file key
liftIO $ createSymbolicLink l file
@@ -112,6 +112,8 @@ link file key hascontent = handle (undo file key) $ do
mtime <- modificationTime <$> getFileStatus file
touch file (TimeSpec mtime) False
+ return l
+
{- Note: Several other commands call this, and expect it to
- create the symlink and add it. -}
cleanup :: FilePath -> Key -> Bool -> CommandCleanup