git-p4: fix syncing file types with pattern

Example of pattern file type: text+k Text filtered through the p4 pattern regexp must be converted from string back to bytes, otherwise 'data' command for the fast-import will receive extra invalid characters, followed by the fast-import process error. CC: Yang Zhao <yang.zhao@skyboxlabs.com> Signed-off-by: Daniel Levin <dendy.ua@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Daniel Levin committed Dec 23, 2020 at 14:37 UTC 52fc4f195c93eb2b1d1edfae69079646d8c2ea99
1 file changed +1 -1
git-p4.py
+1 -1
@@ -3031,7 +3031,7 @@ class P4Sync(Command, P4UserMap):
3031 regexp = re.compile(pattern, re.VERBOSE)
3032 text = ''.join(decode_text_stream(c) for c in contents)
3033 text = regexp.sub(r'$\1$', text)
3034 - contents = [ text ]
3034 + contents = [ encode_text_stream(text) ]
3035
3036 if self.largeFileSystem:
3037 (git_mode, contents) = self.largeFileSystem.processContent(git_mode, relPath, contents)