Skip to content

Commit b39c361

Browse files
Evan Powersgitster
authored andcommitted
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 <[email protected]> Acked-by: Pete Wyckoff <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4551d03 commit b39c361

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

contrib/fast-import/git-p4

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -967,9 +967,8 @@ class P4Sync(Command):
967967
elif file["type"] == "symlink":
968968
mode = "120000"
969969
# 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]]
973972

974973
if self.isWindows and file["type"].endswith("text"):
975974
mangled = []

0 commit comments

Comments
 (0)