Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Miller2018-06-21 18:18:48 +0000
committerMarco Miller2018-06-21 19:38:56 +0000
commit1dcb0688c7c229501e6a486c03ffe251d5ed2761 (patch)
tree87a673b2175be803b76134c5fd1ef76874b2ccb3 /.gitattributes
parentbb5dab961344e58ea6c211a73f735f4e8265580b (diff)
downloadjgit-1dcb0688c7c229501e6a486c03ffe251d5ed2761.tar.gz
jgit-1dcb0688c7c229501e6a486c03ffe251d5ed2761.tar.xz
jgit-1dcb0688c7c229501e6a486c03ffe251d5ed2761.zip
ResolveMerger: Fix encoding with string; use bytes
This change fixes the issue [1]. Before this fix, a merge involving the caching of consecutive yet similar filenames with Norwegian characters [2] used to throw an IllegalStateException: Duplicate stages not allowed. This was caused by inaccurate decoding of the filenames, using string values assuming default encoding. In the toString method of DirCacheEntry, used before through getPathString, UTF-8 encoding is used, but the end result becomes default encoding, through Object's default toString usage. The special characters in those two consecutive (particular) filenames [2] were becoming the very same decoded /single character, lending consecutive -but then identical- filenames. Thus the perceived duplicate 0-staging of the file(s). Replace getPathString usage with getRawPath for this specific case, or use byte array representations of cached entries instead of string. Adding a test for this change is not possible, as there is no known way to change the default encoding for filenames such as [2] (e.g.). JGitTestUtil does write file contents through UTF-8, but encoding like so does not apply to the actual file name. Hence there is no way to create files with names properly made of special characters such as [2]'s. And the test that is necessary for this case assumes such Norwegian (or similar characters) filenames. Changing the default locale programmatically in a test has no effect either. And changing the LANG value passed to the JVM is only possible upon starting it. [1] https://bugs.chromium.org/p/gerrit/issues/detail?id=9153 [2] <=> (...) "a/b/SíÒr-Norge.map", "a/b/Sør-Norge.map", (...) Change-Id: Ib9f2f5297932337c9817064cc09d9f774dd168f4 Signed-off-by: Marco Miller <marco.miller@ericsson.com>
Diffstat (limited to '.gitattributes')
0 files changed, 0 insertions, 0 deletions

Back to the top