@matheusbsbs / matheus-bagliano / commits / b39c3612eb
Fork 0

git-p4: fix bug in symlink handling

Fix inadvertent breakage from b932705 (git-p4: stream from perforce to speed up clones, 2009-07-30) in the code that strips the trailing '\n' from p4 print on a symlink. (In practice, contents is of the form ['target\n', ''].) Signed-off-by: Evan Powers <evan.powers@gmail.com> Acked-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Evan Powers committed Feb 16, 2010 at 00:44 UTC b39c3612eb443e77bd04d645578e1155988c6dde
1 file changed +2 -3
contrib/fast-import/git-p4
+2 -3
@@ -967,9 +967,8 @@ class P4Sync(Command):
967 elif file["type"] == "symlink":
968 mode = "120000"
969 # p4 print on a symlink contains "target\n", so strip it off
970 - last = contents.pop()
971 - last = last[:-1]
972 - contents.append(last)
970 + data = ''.join(contents)
971 + contents = [data[:-1]]
972
973 if self.isWindows and file["type"].endswith("text"):
974 mangled = []