summaryrefslogtreecommitdiff
path: root/Annex/Link.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-07-08 13:54:42 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-07-08 13:55:11 -0400
commit84ffc8f7d265c8a685c1ea081c8a8871c7ee1b44 (patch)
tree10c36135ebc8b298d18ee7f633fed61a5d31a2e4 /Annex/Link.hs
parent069e875da6d98f0d10c390541ccac733bea41e2b (diff)
Fix bug in automatic merge conflict resolution
When one side is an annexed symlink, and the other side is a non-annexed symlink. In this case, git-merge does not replace the annexed symlink in the work tree with the non-annexed symlink, which is different from it's handling of conflicts between annexed symlinks and regular files or directories. So, while git-annex generated the correct merge commit, the work tree didn't get updated to reflect it. See comments on bug for additional analysis. Did not add this to the test suite yet; just unloaded a truckload of firewood and am feeling lazy. This commit was sponsored by Adam Spiers.
Diffstat (limited to 'Annex/Link.hs')
-rw-r--r--Annex/Link.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Annex/Link.hs b/Annex/Link.hs
index 26991e911..25166bff5 100644
--- a/Annex/Link.hs
+++ b/Annex/Link.hs
@@ -68,6 +68,9 @@ getAnnexLinkTarget file = ifM (coreSymlinks <$> Annex.getGitConfig)
then ""
else s
+makeAnnexLink :: LinkTarget -> FilePath -> Annex ()
+makeAnnexLink = makeGitLink
+
{- Creates a link on disk.
-
- On a filesystem that does not support symlinks, writes the link target
@@ -75,8 +78,8 @@ getAnnexLinkTarget file = ifM (coreSymlinks <$> Annex.getGitConfig)
- it's staged as such, so use addAnnexLink when adding a new file or
- modified link to git.
-}
-makeAnnexLink :: LinkTarget -> FilePath -> Annex ()
-makeAnnexLink linktarget file = ifM (coreSymlinks <$> Annex.getGitConfig)
+makeGitLink :: LinkTarget -> FilePath -> Annex ()
+makeGitLink linktarget file = ifM (coreSymlinks <$> Annex.getGitConfig)
( liftIO $ do
void $ tryIO $ removeFile file
createSymbolicLink linktarget file