Skip to content

Commit

Permalink
Use regex to improve commit id/hash test, cc notatestuser#96
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterDaveHello committed Nov 6, 2017
1 parent b609d3d commit 20ee383
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/commit.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ module.exports = class Commit
lines = text.split "\n"
while lines.length
id = _.last lines.shift().split(" ")
break if !id
break if !/^[a-f0-9]{40}$/.test(id)
tree = _.last lines.shift().split(" ")

parents = []
Expand Down

0 comments on commit 20ee383

Please sign in to comment.