From 20ee38379ea968d10040e2833b77345668df65e9 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Mon, 6 Nov 2017 20:07:39 +0800 Subject: [PATCH] Use regex to improve commit id/hash test, cc #96 --- src/commit.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commit.coffee b/src/commit.coffee index 22c087a..6682a97 100644 --- a/src/commit.coffee +++ b/src/commit.coffee @@ -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 = []