/**
 * @module lib/git
 * @exports {Function} Git
 */
'use strict'

var Promise = require('bluebird')
var find = require('101/find')
var hasKeypaths = require('101/has-keypaths')
var simpleGit = require('simple-git')

class Git {
  constructor () {
    this._simpleGit = simpleGit(process.cwd())
    this._simpleGit.getRemotes = Promise.promisify(this._simpleGit.getRemotes)
    this._simpleGit.revparse = Promise.promisify(this._simpleGit.revparse)
  }
  /**
   * Fetch repository info of cwd, returns formatted object with selected properties
   * @param {Function} cb
   * @returns {Object} Promise, if successful, will resolve with object:
   *   - branch: {String
   *   - orgName: {String}
   *   - repoName: {String}
   */
  fetchRepositoryInfo () {
    var fetchBranch = this._simpleGit.revparse(['--abbrev-ref', 'HEAD'])
      .then((status) => {
        return status.replace(/\n$/, '')
      })

    var fetchRemote = this._simpleGit.getRemotes(true)
      .then((remotes) => {
        var originRemote = find(remotes, hasKeypaths({name: 'origin'}))
        if (!originRemote) {
          throw new Error('No "origin" remote found for repository')
        }
        var matches = originRemote.refs.fetch.match(/(\:|\/)([A-z0-9-_]+)\/([A-z0-9-_]+)\.git$/)
        return {
          orgName: matches[2],
          repoName: matches[3]
        }
      })

    return Promise.join(fetchBranch, fetchRemote, (branch, remote) => {
      remote.branch = branch
      return remote
    })
  }
}

module.exports = Git

@@ -91,24 +91,61 @@
 'bluebird')%0A
+var compose = require('101/compose')%0A
 var find = r
@@ -159,24 +159,24 @@
 '101/find')%0A
-
 var hasKeypa
@@ -209,16 +209,49 @@
 paths')%0A
+var pluck = require('101/pluck')%0A
 var simp
@@ -359,16 +359,97 @@
 .cwd())%0A
+    this._simpleGit.checkIgnore = Promise.promisify(this._simpleGit.checkIgnore)%0A
     this
@@ -733,40 +733,17 @@
 rns 
-%7BObject%7D Promise, if successful,
+Promise -
  wil
@@ -752,21 +752,16 @@
 resolve 
-with 
 object:%0A
@@ -1602,16 +1602,16 @@
  remote%0A
-
     %7D)%0A 
@@ -1612,16 +1612,426 @@
   %7D)%0A  %7D
+%0A%0A  /**%0A   * Check if a filepath is ignored by git according to .gitignore rules. Accounts for .gitignore%0A   * files in repository subdirectories.%0A   * @param %7BString%7D relativePath - relative path of file from repository root%0A   * @return Promise - will resolve Boolean%0A   */%0A  checkIgnore (relativePath) %7B%0A    return this._simpleGit.checkIgnore(relativePath)%0A      .then(compose(Boolean, pluck('length')))%0A  %7D
 %0A%7D%0A%0Amodu

Add git checkIgnore instance method to git class