From 1a367cad831541970a4115b00bb42f84ad88ceef Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 18 Feb 2019 17:16:39 -0400 Subject: [PATCH] Fix path separator bug on Windows that completely broke git-annex since version 7.20190122. --- Annex/Link.hs | 8 ++++---- CHANGELOG | 2 ++ ...comment_2_4a37c0d8abbc64abd383d0d306be31f6._comment | 10 ++++++++++ 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 doc/bugs/windows_support_totally_bitrotted/comment_2_4a37c0d8abbc64abd383d0d306be31f6._comment diff --git a/Annex/Link.hs b/Annex/Link.hs index 40f5ac7ee1..db691aea3a 100644 --- a/Annex/Link.hs +++ b/Annex/Link.hs @@ -290,12 +290,12 @@ isPointerFile f = catchDefaultIO Nothing $ withFile f ReadMode $ \h -> isLinkToAnnex :: S.ByteString -> Bool isLinkToAnnex s = p `S.isInfixOf` s #ifdef mingw32_HOST_OS - -- '/' is still used inside pointer files on Windows, not the native - -- '\' + -- '/' is used inside pointer files on Windows, not the native '\' || p' `S.isInfixOf` s #endif where - p = toRawFilePath (pathSeparator:objectDir) + sp = (pathSeparator:objectDir) + p = toRawFilePath sp #ifdef mingw32_HOST_OS - p' = toRawFilePath ('/':objectDir) + p' = toRawFilePath (toInternalGitPath sp) #endif diff --git a/CHANGELOG b/CHANGELOG index 5738ed4cd0..34cb40c7b9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -29,6 +29,8 @@ git-annex (7.20190130) UNRELEASED; urgency=medium package. * init: Fix bug when direct mode needs to be enabled on a crippled filesystem, that left the repository in indirect mode. + * Fix path separator bug on Windows that completely broke git-annex + since version 7.20190122. -- Joey Hess Wed, 30 Jan 2019 12:30:22 -0400 diff --git a/doc/bugs/windows_support_totally_bitrotted/comment_2_4a37c0d8abbc64abd383d0d306be31f6._comment b/doc/bugs/windows_support_totally_bitrotted/comment_2_4a37c0d8abbc64abd383d0d306be31f6._comment new file mode 100644 index 0000000000..1dd76847b6 --- /dev/null +++ b/doc/bugs/windows_support_totally_bitrotted/comment_2_4a37c0d8abbc64abd383d0d306be31f6._comment @@ -0,0 +1,10 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 2""" + date="2019-02-18T21:03:54Z" + content=""" +isLinkToAnnex failing on windows because of mixed path separator issues +caused by [[!commit 5d98cba923e541be4dc9fd36f5f3c4a37b465bf1]]. + +Verified it's working in both direct and v7 unlocked with that fixed. +"""]]