diff options
author | 2015-08-11 18:43:42 -0400 | |
---|---|---|
committer | 2015-08-11 18:46:10 -0400 | |
commit | ebfe4dd1b428d801c9a7ec44566ded422dc52c8b (patch) | |
tree | 1e78712fb65aacda08825c1df357c2f47af880f3 /Git | |
parent | 88aeb849f620a13da47508045daae461a223c997 (diff) |
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.
Diffstat (limited to 'Git')
-rw-r--r-- | Git/UnionMerge.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Git/UnionMerge.hs b/Git/UnionMerge.hs index 26bb3d39f..bb42e7cc5 100644 --- a/Git/UnionMerge.hs +++ b/Git/UnionMerge.hs @@ -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. - |