Skip to content

Commit

Permalink
Handle HG:Extra lines in commit parsing
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Gord Tanner committed Oct 5, 2015
1 parent 6c68dd0 commit 73376e4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/commit.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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(" ")
Expand Down

0 comments on commit 73376e4

Please sign in to comment.