From b02c68304aa5051086e29a0cb6547fdf856aa93d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 12 May 2013 17:18:48 -0500 Subject: deal with git using / internally, even on DOS --- Annex/CatFile.hs | 3 ++- Annex/Link.hs | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) mode change 100644 => 100755 Annex/CatFile.hs mode change 100644 => 100755 Annex/Link.hs (limited to 'Annex') diff --git a/Annex/CatFile.hs b/Annex/CatFile.hs old mode 100644 new mode 100755 index 292d62460..c7c01b40c --- a/Annex/CatFile.hs +++ b/Annex/CatFile.hs @@ -21,6 +21,7 @@ import qualified Git import qualified Git.CatFile import qualified Annex import Git.Types +import Git.FilePath catFile :: Git.Branch -> FilePath -> Annex L.ByteString catFile branch file = do @@ -48,7 +49,7 @@ catFileHandle = maybe startup return =<< Annex.getState Annex.catfilehandle {- From the Sha or Ref of a symlink back to the key. -} catKey :: Ref -> Annex (Maybe Key) catKey ref = do - l <- encodeW8 . L.unpack <$> catObject ref + l <- fromInternalGitPath . encodeW8 . L.unpack <$> catObject ref return $ if isLinkToAnnex l then fileKey $ takeFileName l else Nothing diff --git a/Annex/Link.hs b/Annex/Link.hs old mode 100644 new mode 100755 index 931836d31..24ec6c7c9 --- a/Annex/Link.hs +++ b/Annex/Link.hs @@ -18,6 +18,7 @@ import qualified Git.HashObject import qualified Git.UpdateIndex import qualified Annex.Queue import Git.Types +import Git.FilePath type LinkTarget = String @@ -74,7 +75,8 @@ addAnnexLink linktarget file = do {- Injects a symlink target into git, returning its Sha. -} hashSymlink :: LinkTarget -> Annex Sha -hashSymlink linktarget = inRepo $ Git.HashObject.hashObject BlobObject linktarget +hashSymlink linktarget = inRepo $ Git.HashObject.hashObject BlobObject $ + toInternalGitPath linktarget {- Stages a symlink to the annex, using a Sha of its target. -} stageSymlink :: FilePath -> Sha -> Annex () -- cgit v1.2.3