From ebb47a974bc0665419cdf9d5c0ed4c4ed95636c8 Mon Sep 17 00:00:00 2001 From: Hauke Henningsen Date: Mon, 20 Apr 2015 23:17:40 +0200 Subject: Fix bug #86 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of matching the git commit file for emails which contain at least one character, match for “emails” which also may be empty. Also, use greedy regex matching in those places which is likely to be more performant than non-greedy matching. --- lib/fetchGitData.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/fetchGitData.js b/lib/fetchGitData.js index 67b6190..a6abba4 100644 --- a/lib/fetchGitData.js +++ b/lib/fetchGitData.js @@ -59,7 +59,7 @@ function fetchBranch(git, cb) { }); } -var REGEX_COMMIT_DETAILS = /\nauthor (.+?) <(.+?)>.+\ncommitter (.+?) <(.+?)>.+\n?[\S\s]+?\n\n(.*)/m; +var REGEX_COMMIT_DETAILS = /\nauthor (.+?) <([^>]*)>.+\ncommitter (.+?) <([^>]*)>.+\n?[\S\s]+?\n\n(.*)/m; function fetchHeadDetails(git, cb) { exec('git cat-file -p ' + git.head.id, function(err, response) { -- cgit v1.2.3