From 4a5cb7f2f5412bbcc78b6e695a9bed580b2183d7 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 7 Feb 2018 11:33:07 +0000 Subject: [PATCH] Ensure commit list has a refs object even if empty --- red/runtime/storage/localfilesystem/projects/git/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/red/runtime/storage/localfilesystem/projects/git/index.js b/red/runtime/storage/localfilesystem/projects/git/index.js index c8826414c..48f214862 100644 --- a/red/runtime/storage/localfilesystem/projects/git/index.js +++ b/red/runtime/storage/localfilesystem/projects/git/index.js @@ -296,8 +296,12 @@ function parseLog(log) { var m = /^(.*): (.*)$/.exec(l); if (m) { // git 2.1.4 (Debian Stable) doesn't support %D for refs - so filter out - if (m[1] === 'refs' && m[2] && m[2] !== '%D') { - currentCommit[m[1]] = m[2].split(",").map(function(v) { return v.trim() }); + if (m[1] === 'refs' && m[2]) { + if (m[2] !== '%D') { + currentCommit[m[1]] = m[2].split(",").map(function(v) { return v.trim() }); + } else { + currentCommit[m[1]] = []; + } } else { if (m[1] === 'parents') { currentCommit[m[1]] = m[2].split(" ");