mirror of
https://github.com/git/git.git
synced 2024-11-27 12:03:55 +08:00
Replace \r\n with \n when importing from p4 on Windows
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
This commit is contained in:
parent
ebd8116870
commit
c1f9197f37
@ -540,6 +540,7 @@ class P4Sync(Command):
|
||||
self.verbose = False
|
||||
self.importIntoRemotes = True
|
||||
self.maxChanges = ""
|
||||
self.isWindows = (platform.system() == "Windows")
|
||||
|
||||
def p4File(self, depotPath):
|
||||
return os.popen("p4 print -q \"%s\"" % depotPath, "rb").read()
|
||||
@ -647,6 +648,9 @@ class P4Sync(Command):
|
||||
|
||||
data = self.p4File(depotPath)
|
||||
|
||||
if self.isWindows and file["type"].endswith("text"):
|
||||
data = data.replace("\r\n", "\n")
|
||||
|
||||
self.gitStream.write("M %s inline %s\n" % (mode, relPath))
|
||||
self.gitStream.write("data %s\n" % len(data))
|
||||
self.gitStream.write(data)
|
||||
|
Loading…
Reference in New Issue
Block a user