mirror of
https://github.com/danog/gift.git
synced 2024-11-26 20:04:47 +01:00
Use regex to improve commit id/hash test, cc #96
This commit is contained in:
parent
b609d3d77b
commit
20ee38379e
@ -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 = []
|
||||
|
Loading…
Reference in New Issue
Block a user