From e5f352c3d1739c54c0ce86e7ae9e7503afe56aa0 Mon Sep 17 00:00:00 2001 From: Jeremiah Senkpiel Date: Mon, 11 Jan 2016 13:50:17 -0500 Subject: [PATCH] allow fallback to author checking PR-URL: https://github.com/rvagg/branch-diff/pull/4 --- branch-diff.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/branch-diff.js b/branch-diff.js index 9bcef15..23d5c0c 100755 --- a/branch-diff.js +++ b/branch-diff.js @@ -69,11 +69,16 @@ function diffCollected (options, branchCommits, callback) { return branchCommits[0].some((c) => { if (commit.sha === c.sha) return true - if (commit.summary === c.summary - //&& equal(commit.description, c.description) - && commit.prUrl && c.prUrl - && commit.prUrl === c.prUrl) - return true + if (commit.summary === c.summary) { + if (commit.prUrl && c.prUrl) { + return commit.prUrl === c.prUrl + } else if (commit.author.name === c.author.name + && commit.author.email === c.author.email) { + if (process.stderr.isTTY) + console.error(`Note: Commit fell back to author checking: "${commit.summary}" -`, commit.author) + return true + } + } return false }) }