summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-09-18 14:24:38 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-09-18 14:24:47 -0400
commit2228cd93dcf4d97c10dd728ad7aa8d3e71fdc21c (patch)
tree9e31be464dde5db5b4f54b0b4c26481609505cea
parent2973d859e28ba34fafd4489f659d88e9b1aae609 (diff)
add: In direct mode, adding an annex symlink will check it into git, as was already done in indirect mode.
-rw-r--r--Command/Add.hs11
-rw-r--r--debian/changelog2
2 files changed, 10 insertions, 3 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index 5c7054543..e2b6d04fe 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -75,14 +75,19 @@ start file = ifAnnexed file addpresent add
showStart "add" file
next $ perform file
addpresent key = ifM isDirect
- ( ifM (goodContent key file) ( stop , add )
+ ( do
+ ms <- liftIO $ catchMaybeIO $ getSymbolicLinkStatus file
+ case ms of
+ Just s | isSymbolicLink s -> fixup key
+ _ -> ifM (goodContent key file) ( stop , add )
, fixup key
)
fixup key = do
- -- fixup from an interrupted add; the symlink
- -- is present but not yet added to git
+ -- the annexed symlink is present but not yet added to git
showStart "add" file
liftIO $ removeFile file
+ whenM isDirect $
+ void $ addAssociatedFile key file
next $ next $ cleanup file key Nothing =<< inAnnex key
{- The file that's being added is locked down before a key is generated,
diff --git a/debian/changelog b/debian/changelog
index f11d6d37a..d0bff041d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,8 @@ git-annex (5.20140916) UNRELEASED; urgency=medium
which is not yet supported on Windows.
* WebDav: Fix enableremote crash when the remote already exists.
(Bug introduced in version 5.20140817.)
+ * add: In direct mode, adding an annex symlink will check it into git,
+ as was already done in indirect mode.
-- Joey Hess <joeyh@debian.org> Mon, 15 Sep 2014 14:39:17 -0400