From cf9cc76a65988e71c7f8baac1c2748bc83de6d7d Mon Sep 17 00:00:00 2001 From: Winfield Peterson Date: Tue, 6 Dec 2016 15:33:54 -0500 Subject: [PATCH] Capistrano deploy_notice doesn't extract changelog w/out revisions Ensure we have a value for the current/previous revisions before attempting to pull the changelog for revisions "previous..current". Fixes error `fatal: ..: '..' is outside repository` produced by string wil nil values for both. --- lib/new_relic/recipes/capistrano3.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/new_relic/recipes/capistrano3.rb b/lib/new_relic/recipes/capistrano3.rb index 4889159df7..106c4ba19a 100644 --- a/lib/new_relic/recipes/capistrano3.rb +++ b/lib/new_relic/recipes/capistrano3.rb @@ -63,9 +63,11 @@ def send_deployment_notification_to_newrelic end def lookup_changelog - debug "Retrieving changelog for New Relic Deployment details" previous_revision = fetch(:previous_revision) current_revision = fetch(:current_revision) + return unless current_revision && previous_revision + + debug "Retrieving changelog for New Relic Deployment details" if scm == :git log_command = "git --no-pager log --no-color --pretty=format:' * %an: %s' " +