work around windows having infected git's plumbing
Work around git cat-file --batch's odd stripping of carriage return from the end of the line (some windows infection), avoiding crashing when the repo contains a filename ending in a carriage return.
This commit is contained in:
parent
9a87b3ad31
commit
f4dd7d5191
4 changed files with 55 additions and 0 deletions
|
@ -132,6 +132,10 @@ query hdl object newlinefallback receive
|
|||
-- filename itself contains a newline, have to fall back to another
|
||||
-- method of getting the information.
|
||||
| '\n' `elem` s = newlinefallback
|
||||
-- git strips carriage return from the end of a line, out of some
|
||||
-- misplaced desire to support windows, so also use the newline
|
||||
-- fallback for those.
|
||||
| "\r" `isSuffixOf` s = newlinefallback
|
||||
| otherwise = CoProcess.query hdl send receive
|
||||
where
|
||||
send to = hPutStrLn to s
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue