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

    false))

(defn- data-from-repo
  [name]
  (try
    (let [file (str name ".clj")
          branch (repo-branch env 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 environment = prod"
  [environment name]
  (if (and (not= environment name) (= environment "prod"))
    "prod"
    "master"))

