Skip to content

Commit

Permalink
Merge branch 'aj/p4-symlink-lose-nl'
Browse files Browse the repository at this point in the history
* aj/p4-symlink-lose-nl:
  git-p4: Fix occasional truncation of symlink contents.
  • Loading branch information
Junio C Hamano committed Sep 4, 2013
2 parents 4f5e972 + 1292df1 commit a62b071
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions git-p4.py
Original file line number Diff line number Diff line change
Expand Up @@ -2180,9 +2180,13 @@ def streamOneP4File(self, file, contents):
git_mode = "100755"
if type_base == "symlink":
git_mode = "120000"
# p4 print on a symlink contains "target\n"; remove the newline
# p4 print on a symlink sometimes contains "target\n";
# if it does, remove the newline
data = ''.join(contents)
contents = [data[:-1]]
if data[-1] == '\n':
contents = [data[:-1]]
else:
contents = [data]

if type_base == "utf16":
# p4 delivers different text in the python output to -G
Expand Down

0 comments on commit a62b071

Please sign in to comment.