Browse Source

[CI] haxe-output: push even when no commit hash is found in previous log.
It can happen when someone manually committed something into the haxe-output repo.

Andy Li 9 years ago
parent
commit
aeab8c7622
1 changed files with 13 additions and 10 deletions
  1. 13 10
      tests/RunCi.hx

+ 13 - 10
tests/RunCi.hx

@@ -662,17 +662,20 @@ class RunCi {
 			var firstOutputCommit = firstOutputBranch || {
 				var lastLog = commandResult("git", ["show", "-s", "--pretty=format:%B", "HEAD"]).stdout;
 				var commitRe = ~/[a-f0-9]{40}/;
-				if (!commitRe.match(lastLog))
-					throw "No commit sha found in log: " + lastLog;
-				var lastCommit = commitRe.matched(0);
-
-				// check to see whether this commit is newer than the last pushed one
-				// in case e.g. the current build is a rebuild of an old commit
-				if (haxeCommitTime(lastCommit) > gitInfo.timestamp) {
-					throw "There exists output with a later commit in the haxe-output repo.";
-				}
+				if (!commitRe.match(lastLog)) {
+					infoMsg("No commit sha found in log: " + lastLog);
+					true;
+				} else {
+					var lastCommit = commitRe.matched(0);
 
-				lastCommit != gitInfo.commit;
+					// check to see whether this commit is newer than the last pushed one
+					// in case e.g. the current build is a rebuild of an old commit
+					if (haxeCommitTime(lastCommit) > gitInfo.timestamp) {
+						throw "There exists output with a later commit in the haxe-output repo.";
+					}
+
+					lastCommit != gitInfo.commit;
+				}
 			};
 
 			// Remove all the old output first.