summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-02-15 16:12:18 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-02-15 16:12:18 -0400
commite892768b0e63a9b64ecd6edbdb1021227b082973 (patch)
tree0cb09ecfc869e028182b59c21747da71c7033135
parent81b98efabf922521bde4117ddab4bb36bd617b31 (diff)
Windows: Fix v6 unlocked files to actually work.
Pointer files were not being treated as annex content, so "git annex get" didn't replace them with the object.
-rw-r--r--Annex/Link.hs17
-rw-r--r--Annex/Locations.hs10
-rw-r--r--Upgrade/V1.hs1
-rw-r--r--debian/changelog1
4 files changed, 19 insertions, 10 deletions
diff --git a/Annex/Link.hs b/Annex/Link.hs
index 7fd0098ef..4a3311af9 100644
--- a/Annex/Link.hs
+++ b/Annex/Link.hs
@@ -12,6 +12,8 @@
- Licensed under the GNU GPL version 3 or higher.
-}
+{-# LANGUAGE CPP #-}
+
module Annex.Link where
import Annex.Common
@@ -155,3 +157,18 @@ formatPointer k =
isPointerFile :: FilePath -> IO (Maybe Key)
isPointerFile f = catchDefaultIO Nothing $
parseLinkOrPointer <$> L.readFile f
+
+{- Checks a symlink target or pointer file first line to see if it
+ - appears to point to annexed content.
+ -
+ - We only look for paths inside the .git directory, and not at the .git
+ - directory itself, because GIT_DIR may cause a directory name other
+ - than .git to be used.
+ -}
+isLinkToAnnex :: FilePath -> Bool
+isLinkToAnnex s = (pathSeparator:objectDir) `isInfixOf` s
+#ifdef mingw32_HOST_OS
+ -- '/' is still used inside pointer files on Windows, not the native
+ -- '\'
+ || ('/':objectDir) `isInfixOf` s
+#endif
diff --git a/Annex/Locations.hs b/Annex/Locations.hs
index 322165aee..4c2816fa9 100644
--- a/Annex/Locations.hs
+++ b/Annex/Locations.hs
@@ -63,7 +63,6 @@ module Annex.Locations (
gitAnnexSshDir,
gitAnnexRemotesDir,
gitAnnexAssistantDefaultDir,
- isLinkToAnnex,
HashLevels(..),
hashDirMixed,
hashDirLower,
@@ -386,15 +385,6 @@ gitAnnexRemotesDir r = addTrailingPathSeparator $ gitAnnexDir r </> "remotes"
gitAnnexAssistantDefaultDir :: FilePath
gitAnnexAssistantDefaultDir = "annex"
-{- Checks a symlink target to see if it appears to point to annexed content.
- -
- - We only look at paths inside the .git directory, and not at the .git
- - directory itself, because GIT_DIR may cause a directory name other
- - than .git to be used.
- -}
-isLinkToAnnex :: FilePath -> Bool
-isLinkToAnnex s = (pathSeparator:objectDir) `isInfixOf` s
-
{- Sanitizes a String that will be used as part of a Key's keyName,
- dealing with characters that cause problems on substandard filesystems.
-
diff --git a/Upgrade/V1.hs b/Upgrade/V1.hs
index 165d44912..90e1a62a0 100644
--- a/Upgrade/V1.hs
+++ b/Upgrade/V1.hs
@@ -13,6 +13,7 @@ import Data.Default
import Annex.Common
import Annex.Content
+import Annex.Link
import Logs.Presence
import qualified Annex.Queue
import qualified Git
diff --git a/debian/changelog b/debian/changelog
index ad9f3b672..cd8387987 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,7 @@ git-annex (6.20160212) UNRELEASED; urgency=medium
present in annex/objects but didn't reach the work tree.
* When initializing a v6 repo on a crippled filesystem, don't force it
into direct mode.
+ * Windows: Fix v6 unlocked files to actually work.
-- Joey Hess <id@joeyh.name> Fri, 12 Feb 2016 14:03:46 -0400