 
   handleQuery: (query = {}) -> @ready =>
 
-    repo = getRepoFromQuery query
+    { repo, commitId } = parseQuery query
 
     @message.hide()
     @actionButton.hide()

    branch = Encoder.XSSEncode branch
    repo = "#{repo}/#{branch}"  if branch

  return repo


module.exports = class HomeStacksImport extends kd.CustomHTMLView

    @outputView.show()
    @outputView.add 'Got repo as follow:', repo

    { computeController, groupsController, router } = kd.singletons

    if commitId
      @outputView.add 'Checking existing VM for given commit id:', commitId
      if machine = computeController.findMachineFromRemoteData { commitId }
        @outputView.add "Found VM: #{machine.label} redirecting..."
        kd.utils.wait 2000, ->
          router.handleRoute "/IDE/#{machine.slug}"
        return

      @outputView.add "Couldn't find any VM, processing request..."

    groupsController.ready =>

