From 73376e4c28408bbebe2a15daefe9d90907fb2b84 Mon Sep 17 00:00:00 2001 From: Gord Tanner Date: Mon, 5 Oct 2015 16:20:22 -0400 Subject: [PATCH] Handle HG:Extra lines in commit parsing There is a chance that a commit has N number of HG: lines in a commit. see: https://github.com/mozilla/addon-sdk This will filter those lines out so parsing still works --- src/commit.coffee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/commit.coffee b/src/commit.coffee index 6296adc..af2b5d2 100644 --- a/src/commit.coffee +++ b/src/commit.coffee @@ -89,6 +89,12 @@ module.exports = class Commit while /^kilnhgcopies/.test lines[0] lines.shift() + # if converted from mercurial gpgsig may be present with non-valid gpg lines + # e.g. "HG:extra rebase_source:6c01d74dd05f50ede33608fe3f1b2049d93abbda" + # and "HG:rename-source hg" + while /^HG:/.test lines[0] + lines.shift() + # not doing anything with this yet, but it's sometimes there if /^encoding/.test lines[0] encoding = _.last lines.shift().split(" ")