git-p4: cope with labels with empty descriptions
Use an explicit length for the data in a label, rather than EOT, so that labels with empty descriptions are passed through correctly. Signed-off-by: Luke Diamand <luke@diamand.org> Acked-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Luke Diamand committed
Jan 19, 2012 at 09:52 UTC
a37a8de8d61f5af3a2d347c6d6668f4316f48383
1 file changed
+5
-3
contrib/fast-import/git-p4
+5
-3
@@ -1741,9 +1741,11 @@ class P4Sync(Command, P4UserMap):
1741
else:
1742
tagger = "%s <a@b> %s %s" % (owner, epoch, self.tz)
1743
self.gitStream.write("tagger %s\n" % tagger)
1744
- self.gitStream.write("data <<EOT\n")
1745
- self.gitStream.write(labelDetails["Description"])
1746
- self.gitStream.write("EOT\n\n")
1744
+
1745
+ description = labelDetails["Description"]
1746
+ self.gitStream.write("data %d\n" % len(description))
1747
+ self.gitStream.write(description)
1748
+ self.gitStream.write("\n")
1749
1750
else:
1751
if not self.silent: