Example #1
0
 update: function(done) {
   impromptu.exec('git rev-parse --short HEAD 2>/dev/null', function(err, result) {
     if (err) {
       done(err, null)
     } else {
       done(err, result.trim())
     }
   })
 }
Example #2
0
 update: function(done) {
   var command = 'git rev-parse --show-toplevel 2>/dev/null'
   impromptu.exec(command, function(err, result) {
     if (err) {
       done(err, null)
     } else {
       done(err, result.trim())
     }
   })
 }
Example #3
0
      git.isRepo(function(err, isRepo) {
        if (!isRepo) {
          done(err, isRepo)
          return
        }

        impromptu.exec('git fetch --all', function(err, results) {
          done(err, results)
        })
      })
Example #4
0
        fs.exists(path.join(root, '.git/logs/refs/stash'), function(exists) {
          if (!exists) {
            done(null, 0)
            return
          }

          impromptu.exec("wc -l " + (path.join(root, '.git/logs/refs/stash')), function(err, count) {
            done(err, parseInt(count.trim(), 10))
          })
        })
Example #5
0
    update: function(done) {
      impromptu.exec('git status -uno --porcelain -z 2>/dev/null', function(err, result) {
        if (err) {
          done(err, null)
          return
        }

        var statuses = getStatuses(result)
        done(null, new Statuses(statuses))
      })
    }
Example #6
0
    update: function(done) {
      var trackingBranchCommand = "git rev-parse --abbrev-ref --symbolic-full-name @{u}"

      impromptu.exec(trackingBranchCommand, function(err, result) {
        if (result) {
          done(err, result.trim())
        } else {
          done(err, null)
        }
      })
    }
Example #7
0
      impromptu.exec(command, function(err, result) {
        if (err) {
          done(err, null)
          return
        }

        result = result.trim()
        if (result !== 'HEAD') {
          done(err, result)
          return
        }

        impromptu.exec('git rev-parse --short HEAD', function(_err, _result) {
          done(_err, _result)
        })
      })
Example #8
0
      git.root(function(err, root) {
        if (err) {
          done(err)
          return
        }

        var command = "test -d " + root + "/.git/rebase-merge -o -d " + root + "/.git/rebase-apply"
        impromptu.exec(command, function(err) {
          if (!err) {
            done(null, true)
          } else if (err.code === 1) {
            done(null, false)
          } else {
            done(err, null)
          }
        })
      })
Example #9
0
    update: function(done) {
      var command = 'git rev-parse --abbrev-ref HEAD 2>/dev/null'
      impromptu.exec(command, function(err, result) {
        if (err) {
          done(err, null)
          return
        }

        result = result.trim()
        if (result !== 'HEAD') {
          done(err, result)
          return
        }

        impromptu.exec('git rev-parse --short HEAD', function(_err, _result) {
          done(_err, _result)
        })
      })
    }
Example #10
0
        git.remoteBranch(function(err, remoteBranch) {
          if (!remoteBranch) {
            done(err, null)
            return
          }

          var command = "git rev-list --left-right --count " + (remoteBranch.trim()) + "...HEAD"
          impromptu.exec(command, function(err, result) {
            if (err) {
              done(err, null)
              return
            }

            var data = result.trim().split(/\s+/).map(function(value) {
              return parseInt(value, 10)
            })

            done(err, {
              behind: data[0],
              ahead: data[1]
            })
          })
        })
Example #11
0
 update: function(done) {
   var command = '([ -d .git ] || [[ "true" == `git rev-parse --is-inside-work-tree 2>&1` ]])'
   impromptu.exec(command, function(err) {
     done(err, !err)
   })
 }
Example #12
0
 update: function(done) {
   impromptu.exec('git config --get remote.origin.url', done)
 }
Example #13
0
 update: function(done) {
   impromptu.exec('git symbolic-ref HEAD 2>/dev/null', function(err) {
     done(err, !!err)
   })
 }