Unreviewed build fix after r179591.
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 14 Feb 2015 01:09:16 +0000 (01:09 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 14 Feb 2015 01:09:16 +0000 (01:09 +0000)
* public/api/commits.php:

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

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/public/api/commits.php

index 3262f874a5ea8f2926ad5800bdb333f940e08c0b..c57a72986bdb7b8cb4c1cc77bac5d7d518ed5f6d 100644 (file)
@@ -1,3 +1,9 @@
+2015-02-13  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Unreviewed build fix after r179591.
+
+        * public/api/commits.php:
+
 2015-02-13  Ryosuke Niwa  <rniwa@webkit.org>
 
         The status of a A/B testing request always eventually becomes "Failed"
index d0bbe0f6c82fe8f92a6c72a5bcaa0cdb38d9c02e..d1d79a3ef5579707ccd2c75c07d1641c672d94c2 100644 (file)
@@ -10,7 +10,14 @@ function main($paths) {
     if (!$db->connect())
         exit_with_error('DatabaseConnectionFailure');
 
-    $repository_id = intval($paths[0]);
+    if (!is_numeric($paths[0])) {
+        $repository_name = $paths[0];
+        $repository_row = $db->select_first_row('repositories', 'repository', array('name' => $repository_name));
+        if (!$repository_row)
+            exit_with_error('RepositoryNotFound', array('repositoryName' => $repository_name));
+        $repository_id = $repository_row['repository_id'];
+    } else
+        $repository_id = intval($paths[0]);
 
     $filter = array_get($paths, 1);
     $single_commit = NULL;