summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG2
-rw-r--r--Git/HashObject.hs6
-rw-r--r--doc/bugs/Whereis_reports_same_UUID_multiple_times.mdwn3
-rw-r--r--doc/bugs/Whereis_reports_same_UUID_multiple_times/comment_6_d3adcfad215b3f39cc5bc3ff248e4b86._comment15
4 files changed, 26 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG
index ff09e72aa..5daca2386 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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
diff --git a/Git/HashObject.hs b/Git/HashObject.hs
index 07c72d080..ed3baf4c6 100644
--- a/Git/HashObject.hs
+++ b/Git/HashObject.hs
@@ -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
diff --git a/doc/bugs/Whereis_reports_same_UUID_multiple_times.mdwn b/doc/bugs/Whereis_reports_same_UUID_multiple_times.mdwn
index baeea5e0e..249576b1d 100644
--- a/doc/bugs/Whereis_reports_same_UUID_multiple_times.mdwn
+++ b/doc/bugs/Whereis_reports_same_UUID_multiple_times.mdwn
@@ -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]]
diff --git a/doc/bugs/Whereis_reports_same_UUID_multiple_times/comment_6_d3adcfad215b3f39cc5bc3ff248e4b86._comment b/doc/bugs/Whereis_reports_same_UUID_multiple_times/comment_6_d3adcfad215b3f39cc5bc3ff248e4b86._comment
new file mode 100644
index 000000000..30951378e
--- /dev/null
+++ b/doc/bugs/Whereis_reports_same_UUID_multiple_times/comment_6_d3adcfad215b3f39cc5bc3ff248e4b86._comment
@@ -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..
+"""]]