summaryrefslogtreecommitdiff
path: root/Git/HashObject.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2021-01-11 21:52:32 -0400
committerJoey Hess <joeyh@joeyh.name>2021-01-11 21:52:32 -0400
commitad48349741384ed0e49fab9cf13ac7f90aba0dd1 (patch)
tree6b8c894ce1057d069f89e7209c266f00ea43ec66 /Git/HashObject.hs
parentb3e72e94efbce652f25fb99d6c6ace8beb2a52d4 (diff)
downloadgit-repair-ad48349741384ed0e49fab9cf13ac7f90aba0dd1.tar.gz
Merge from git-annex.
Diffstat (limited to 'Git/HashObject.hs')
-rw-r--r--Git/HashObject.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Git/HashObject.hs b/Git/HashObject.hs
index bcad9a1..98bd440 100644
--- a/Git/HashObject.hs
+++ b/Git/HashObject.hs
@@ -36,10 +36,10 @@ hashObjectStop :: HashObjectHandle -> IO ()
hashObjectStop = CoProcess.stop
{- Injects a file into git, returning the Sha of the object. -}
-hashFile :: HashObjectHandle -> FilePath -> IO Sha
+hashFile :: HashObjectHandle -> RawFilePath -> IO Sha
hashFile h file = CoProcess.query h send receive
where
- send to = hPutStrLn to =<< absPath file
+ send to = S8.hPutStrLn to =<< absPath file
receive from = getSha "hash-object" $ S8.hGetLine from
class HashableBlob t where
@@ -60,7 +60,7 @@ hashBlob :: HashableBlob b => HashObjectHandle -> b -> IO Sha
hashBlob h b = withTmpFile "hash" $ \tmp tmph -> do
hashableBlobToHandle tmph b
hClose tmph
- hashFile h tmp
+ hashFile h (toRawFilePath tmp)
{- Injects some content into git, returning its Sha.
-