nitdoc: check github api upstream name correctness at plugin startup
authorAlexandre Terrasa <alexandre@moz-code.org>
Sat, 1 Feb 2014 07:37:42 +0000 (02:37 -0500)
committerAlexandre Terrasa <alexandre@moz-code.org>
Sat, 1 Feb 2014 19:26:24 +0000 (14:26 -0500)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

share/nitdoc/scripts/Nitdoc.GitHub.js

index cdd1b6a..71a10c7 100644 (file)
@@ -49,6 +49,9 @@ Nitdoc.GitHub.UI = function() {
 \r
                // parse origin\r
                var parts = upstream.split(":");\r
+               if(parts.length < 3) {\r
+                       console.error("Incorrect upstream name `" + upstream + "`, should be of the form user:repo:branch");\r
+               }\r
                origin = {\r
                        user: parts[0],\r
                        repo: parts[1],\r