From: Ian Jackson Date: Tue, 14 Aug 2018 09:48:02 +0000 (+0100) Subject: cr-publish-flight-logs: Work with --push-harness but no remote git X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=118d63a37252900379b47c56509103788791cad5;p=osstest.git cr-publish-flight-logs: Work with --push-harness but no remote git --push-harness might be specified even though there is no git tree to push to. In that situation, do not daftly not even push the logs. Signed-off-by: Ian Jackson --- diff --git a/cr-publish-flight-logs b/cr-publish-flight-logs index 7249d03..faae7e0 100755 --- a/cr-publish-flight-logs +++ b/cr-publish-flight-logs @@ -45,15 +45,15 @@ if ($push_harness) { my $githost= $c{HarnessPublishGitUserHost}; my $gitdir= $c{HarnessPublishGitRepoDir}; - exit 0 if (!$githost || !$gitdir); - - eval { + if ($githost && $gitdir) { + eval { system_checked("git push $githost:$gitdir HEAD:refs/heads/flight-$flight"); system_checked("ssh $githost 'cd $gitdir && git update-server-info'"); - }; - if ($@) { - $push_harness eq '--push-harness-try' or die; - warn; + }; + if ($@) { + $push_harness eq '--push-harness-try' or die; + warn; + } } }