Detect symlinks as file type, set the git file mode accordingly and strip o=
ff the trailing newline in the p4 print output.
Signed-off-by: Simon Hausmann <simon@lst.de>
=2D--
contrib/fast-import/git-p4 | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 41e86e7..9c6f911 100755
=2D-- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -839,11 +839,15 @@ class P4Sync(Command):
if file["action"] =3D=3D "delete":
self.gitStream.write("D %s\n" % relPath)
else:
+ data =3D file['data']
+
mode =3D 644
if file["type"].startswith("x"):
mode =3D 755
=2D
=2D data =3D file['data']
+ elif file["type"] =3D=3D "symlink":
+ mode =3D 120000
+ # p4 print on a symlink contains "target\n", so strip =
it off
+ data =3D data[:-1]
=20
if self.isWindows and file["type"].endswith("text"):
data =3D data.replace("\r\n", "\n")
=2D-=20
1.5.3.rc3.91.g5c75