summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG3
-rw-r--r--Utility/Path.hs7
-rw-r--r--doc/bugs/windows_annex_link_wrong.mdwn2
3 files changed, 11 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index bb6189604..e6456173a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -9,6 +9,9 @@ git-annex (6.20171019) UNRELEASED; urgency=medium
Thanks, Sean T Parsons
* Add day to metadata when annex.genmetadata is enabled.
Thanks, Sean T Parsons
+ * Windows: Fix reversion that caused the path used to link
+ to annexed content include the drive letter and full path, rather than
+ being relative. (`git annex fix` will fix up after this problem).
-- Joey Hess <id@joeyh.name> Tue, 24 Oct 2017 13:12:52 -0400
diff --git a/Utility/Path.hs b/Utility/Path.hs
index 0779d1676..0409ff05f 100644
--- a/Utility/Path.hs
+++ b/Utility/Path.hs
@@ -136,7 +136,9 @@ relPathDirToFile from to = relPathDirToFileAbs <$> absPath from <*> absPath to
-}
relPathDirToFileAbs :: FilePath -> FilePath -> FilePath
relPathDirToFileAbs from to
- | takeDrive from /= takeDrive to = to
+#ifdef mingw32_HOST_OS
+ | normdrive from /= normdrive to = to
+#endif
| otherwise = joinPath $ dotdots ++ uncommon
where
pfrom = sp from
@@ -147,6 +149,9 @@ relPathDirToFileAbs from to
uncommon = drop numcommon pto
dotdots = replicate (length pfrom - numcommon) ".."
numcommon = length common
+#ifdef mingw32_HOST_OS
+ normdrive = map toLower . takeWhile (/= ':') . takeDrive
+#endif
prop_relPathDirToFile_basics :: FilePath -> FilePath -> Bool
prop_relPathDirToFile_basics from to
diff --git a/doc/bugs/windows_annex_link_wrong.mdwn b/doc/bugs/windows_annex_link_wrong.mdwn
index 96d1a9673..8a1b29280 100644
--- a/doc/bugs/windows_annex_link_wrong.mdwn
+++ b/doc/bugs/windows_annex_link_wrong.mdwn
@@ -2,3 +2,5 @@ On windows, the links to .git/annex/objects are no longer relative; include
drive letter and full path.
This used to not be the case; it must have gotten broken. --[[Joey]]
+
+> [[fixed|done]]