Skip to content

Commit a37a8de

Browse files
luked99gitster
authored andcommitted
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 <[email protected]> Acked-by: Pete Wyckoff <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 52a4880 commit a37a8de

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

contrib/fast-import/git-p4

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,9 +1741,11 @@ class P4Sync(Command, P4UserMap):
17411741
else:
17421742
tagger = "%s <a@b> %s %s" % (owner, epoch, self.tz)
17431743
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")
17471749

17481750
else:
17491751
if not self.silent:

0 commit comments

Comments
 (0)