Windows: Avoid terminating git-annex branch lines with \r\n when union merging.
This commit is contained in:
parent
45308ec78b
commit
84f20c9f69
4 changed files with 26 additions and 0 deletions
|
@ -1,6 +1,8 @@
|
|||
git-annex (6.20160528) UNRELEASED; urgency=medium
|
||||
|
||||
* Improve SHA*E extension extraction code.
|
||||
* Windows: Avoid terminating git-annex branch lines with \r\n when
|
||||
union merging and performing transitions.
|
||||
|
||||
-- Joey Hess <id@joeyh.name> Fri, 27 May 2016 13:12:48 -0400
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
- Licensed under the GNU GPL version 3 or higher.
|
||||
-}
|
||||
|
||||
{-# LANGUAGE CPP #-}
|
||||
|
||||
module Git.HashObject where
|
||||
|
||||
import Common
|
||||
|
@ -39,6 +41,10 @@ hashFile h file = CoProcess.query h send receive
|
|||
- interface does not allow batch hashing without using temp files. -}
|
||||
hashBlob :: HashObjectHandle -> String -> IO Sha
|
||||
hashBlob h s = withTmpFile "hash" $ \tmp tmph -> do
|
||||
fileEncoding tmph
|
||||
#ifdef mingw32_HOST_OS
|
||||
hSetNewlineMode tmph noNewlineTranslation
|
||||
#endif
|
||||
hPutStr tmph s
|
||||
hClose tmph
|
||||
hashFile h tmp
|
||||
|
|
|
@ -92,3 +92,6 @@ I am running "git-annex version: 6.20160511-g4633f0b" on Windows, but I have bee
|
|||
### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
|
||||
Yes it is working very nicely on all my linux computers, and right now I am mostly concerned that I might have messed up the repository by trying out Windows :-(.
|
||||
|
||||
> [[fixed|done]]; repositories in this state are now handled appropriately
|
||||
> by git-annex. And, I've fixed at least the places I was able to identify
|
||||
> where '\r' slipped in. --[[Joey]]
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
[[!comment format=mdwn
|
||||
username="joey"
|
||||
subject="""comment 1"""
|
||||
date="2016-05-27T19:03:05Z"
|
||||
content="""
|
||||
Union merge on windows does indeed add \r onto lines.
|
||||
|
||||
Looks like hashBlob is at fault; it writes a string to a temp file,
|
||||
and the IO layer does CRLF conversion at that point.
|
||||
|
||||
The git-annex branch transition code also uses hashBlob so would also
|
||||
do it.
|
||||
|
||||
So I've reproduced the root cause of this now. Fixing..
|
||||
"""]]
|
Loading…
Add table
Reference in a new issue