summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-09-04 12:36:37 -0700
committerJunio C Hamano <gitster@pobox.com>2013-09-04 12:36:37 -0700
commita62b071d5b018bc5849d5e9485b4adcdb16e7fa3 (patch)
tree4ecf408f82c99772ac5f0cfe2df51921b49234fb
parent4f5e9726e1fd0f9a5cbf53c70055fc678e48a06c (diff)
parent1292df11e8063442f911b2a4d0f7213f117d54d7 (diff)
downloadgit-a62b071d5b018bc5849d5e9485b4adcdb16e7fa3.tar.gz
Merge branch 'aj/p4-symlink-lose-nl'
* aj/p4-symlink-lose-nl: git-p4: Fix occasional truncation of symlink contents.
-rwxr-xr-xgit-p4.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/git-p4.py b/git-p4.py
index 31e71ff8b2..a53a6dc406 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -2180,9 +2180,13 @@ class P4Sync(Command, P4UserMap):
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