From 335918f28d6cbbac2efbc25990e97549dbd96aee Mon Sep 17 00:00:00 2001 From: Christophe Porteneuve Date: Fri, 8 Nov 2013 19:05:52 +0100 Subject: Fix step 1: for dev-local uses, properly detect local Git branch and commit --- lib/getOptions.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/getOptions.js') diff --git a/lib/getOptions.js b/lib/getOptions.js index 35187b4..abd2f2e 100644 --- a/lib/getOptions.js +++ b/lib/getOptions.js @@ -43,6 +43,14 @@ var getBaseOptions = function(cb){ options.service_job_id = process.env.COVERALLS_SERVICE_JOB_ID; } + if (!git_commit || !git_branch) { + var data = require('./detectLocalGit')(git_commit, git_branch); + if (data) { + git_commit = git_commit || data.git_commit; + git_branch = git_branch || data.git_branch; + } + } + // try to get the repo token as an environment variable if (process.env.COVERALLS_REPO_TOKEN) { options.repo_token = process.env.COVERALLS_REPO_TOKEN; -- cgit v1.2.3