Build fix. OS X "revision" can have a space.
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Aug 2017 21:28:04 +0000 (21:28 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Aug 2017 21:28:04 +0000 (21:28 +0000)
* public/include/commit-log-fetcher.php:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221312 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/public/include/commit-log-fetcher.php

index e26e039..2208a9f 100644 (file)
@@ -1,5 +1,11 @@
 2017-08-29  Ryosuke Niwa  <rniwa@webkit.org>
 
+        Build fix. OS X "revision" can have a space.
+
+        * public/include/commit-log-fetcher.php:
+
+2017-08-29  Ryosuke Niwa  <rniwa@webkit.org>
+
         Make it possible to specify A/B testing revision with a partial hash
         https://bugs.webkit.org/show_bug.cgi?id=176047
 
index 65d95e8..fe3d759 100644 (file)
@@ -8,12 +8,13 @@ class CommitLogFetcher {
 
     static function find_commit_id_by_revision($db, $repository_id, $revision)
     {
-        if (!ctype_alnum($revision))
-            return NULL;
         $commit_rows = $db->query_and_fetch_all('SELECT commit_id FROM commits WHERE commit_repository = $1 AND commit_revision = $2', array($repository_id, $revision));
         if ($commit_rows)
             return $commit_rows[0]['commit_id'];
 
+        if (!ctype_alnum($revision))
+            return NULL;
+
         $commit_rows = $db->query_and_fetch_all('SELECT commit_id FROM commits WHERE commit_repository = $1 AND commit_revision LIKE $2 LIMIT 2', array($repository_id, Database::escape_for_like($revision) . '%'));
         if (!$commit_rows)
             return NULL;