avoid nul-truncation

This might be a little slower, but it's safer, in the event that a
union-merged file contains a NUL.

AFAIK, no files in the git-annex branch do.
This commit is contained in:
Joey Hess 2015-08-11 18:43:42 -04:00
parent 23e9d3bb77
commit 06dac3bfed

View file

@ -93,7 +93,7 @@ mergeFile info file h repo = case filter (/= nullSha) [Ref asha, Ref bsha] of
-- FileSystemEncoding for this is a hack, but ensures there
-- are no decoding errors. Note that this works because
-- hashObject sets fileEncoding on its write handle.
getcontents s = lines . encodeW8 . L.unpack <$> catObject h s
getcontents s = lines . encodeW8NUL . L.unpack <$> catObject h s
{- Calculates a union merge between a list of refs, with contents.
-