Got rid of the last place that did utf8 decoding.
Probably fixes bugs/git-annex:_Cannot_decode_byte___39____92__xfc__39__/ although I don't know how to reproduce that bug.
This commit is contained in:
parent
5faaf59368
commit
1093d82f6b
2 changed files with 8 additions and 4 deletions
|
@ -10,8 +10,7 @@ module Git.UnionMerge (
|
||||||
mergeIndex
|
mergeIndex
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import qualified Data.Text.Lazy as L
|
import qualified Data.ByteString.Lazy as L
|
||||||
import qualified Data.Text.Lazy.Encoding as L
|
|
||||||
import qualified Data.Set as S
|
import qualified Data.Set as S
|
||||||
|
|
||||||
import Common
|
import Common
|
||||||
|
@ -79,10 +78,14 @@ mergeFile info file h repo = case filter (/= nullSha) [Ref asha, Ref bsha] of
|
||||||
=<< calcMerge . zip shas <$> mapM getcontents shas
|
=<< calcMerge . zip shas <$> mapM getcontents shas
|
||||||
where
|
where
|
||||||
[_colonmode, _bmode, asha, bsha, _status] = words info
|
[_colonmode, _bmode, asha, bsha, _status] = words info
|
||||||
getcontents s = map L.unpack . L.lines .
|
|
||||||
L.decodeUtf8 <$> catObject h s
|
|
||||||
use sha = return $ Just $
|
use sha = return $ Just $
|
||||||
updateIndexLine sha FileBlob $ asTopFilePath file
|
updateIndexLine sha FileBlob $ asTopFilePath file
|
||||||
|
-- We don't know how the file is encoded, but need to
|
||||||
|
-- split it into lines to union merge. Using the
|
||||||
|
-- FileSystemEncoding for this is a hack, but ensures there
|
||||||
|
-- are no decoding errors. Note that this works because
|
||||||
|
-- streamUpdateIndex sets fileEncoding on its write handle.
|
||||||
|
getcontents s = lines . encodeW8 . L.unpack <$> catObject h s
|
||||||
|
|
||||||
{- Calculates a union merge between a list of refs, with contents.
|
{- Calculates a union merge between a list of refs, with contents.
|
||||||
-
|
-
|
||||||
|
|
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -5,6 +5,7 @@ git-annex (3.20120625) UNRELEASED; urgency=low
|
||||||
which disables the watch command.
|
which disables the watch command.
|
||||||
* Avoid ugly failure mode when moving content from a local repository
|
* Avoid ugly failure mode when moving content from a local repository
|
||||||
that is not available.
|
that is not available.
|
||||||
|
* Got rid of the last place that did utf8 decoding.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Mon, 25 Jun 2012 11:38:12 -0400
|
-- Joey Hess <joeyh@debian.org> Mon, 25 Jun 2012 11:38:12 -0400
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue