     false))
 
 (defn- data-from-repo
-  [name]
+  [environment name]
   (try
     (let [file (str name ".clj")
-          branch (repo-branch env name)]
+          branch (repo-branch environment name)]
       (:content (repos/contents organisation name file {:ref branch
                                                         :str? true})))
     (catch Exception e

   (conj "prod")))

(defn- repo-branch
  "Only look for the prod branch when env = prod"
  [env name]
  (if (and (not= env name) (= env "prod"))
    "prod"
    "master"))



(defn- *get-data
  "Fetches the data corresponding to the given application from Git"
  [environment name]
  (if-let [data (data-from-repo environment name)]
    data
    (send-error 404 "Missing Shuppet configuration")))

