]> xenbits.xensource.com Git - osstest.git/commitdiff
cr-publish-flight-logs: Work with --push-harness but no remote git
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 14 Aug 2018 09:48:02 +0000 (10:48 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 14 Aug 2018 09:49:35 +0000 (10:49 +0100)
--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 <Ian.Jackson@eu.citrix.com>
cr-publish-flight-logs

index 7249d039800262362e0b10beaf664d55308be408..faae7e0ebf3980380b562784e0b33cd368510db2 100755 (executable)
@@ -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;
+        }
     }
 }