     path: line.slice 3
     properties: (prop for prop, regex of PORCELAIN when regex.test status)
 
-
-module.exports = (Impromptu, register, git) ->
+module.exports = impromptu.plugin.create (git) ->
   # Helper to figure out if we're in a repo at all
-  register 'isRepo',
+  git.register 'isRepo',
     update: (done) ->
       command = '([ -d .git ] || [[ "true" == `git rev-parse --is-inside-work-tree 2>&1` ]])'
-      Impromptu.exec command, (err) ->
+      impromptu.exec command, (err) ->
         done err, ! err
 
   # Root path to the repository
-  register 'root',
+  git.register 'root',
     update: (done) ->
       command = 'git rev-parse --show-toplevel 2>/dev/null'
-      Impromptu.exec command, (err, result) ->
+      impromptu.exec command, (err, result) ->
         if err
           done err, null
         else


  # Determine whether the repo is currently in a detached head state
  # This happens when you checkout, for example, a commit hash
  register 'isDetachedHead',
    update: (done) ->
      Impromptu.exec 'git symbolic-ref HEAD 2>/dev/null', (err) ->
        done err, !! err

  register 'remoteBranch',
    update: (done) ->
      tracking_branch_command = "git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD)"
      Impromptu.exec tracking_branch_command, (err, result) ->
        if result
          done err, result.trim()
        else

impromptu = require 'impromptu'
fs = require 'fs'
path = require 'path'

