Code coverage report for ggit/src/has-changes.js

Statements: 71.43% (5 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 71.43% (5 / 7)      Ignored: none     

All files » ggit/src/ » has-changes.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1 1         1               1  
require('lazy-ass');
var exec = require('./exec');
var d3h = require('d3-helpers');
 
// returns true if there are local uncommitted changes
// see discussion
// http://stackoverflow.com/questions/3878624/
function hasChanges() {
  var cmd = 'git diff --exit-code HEAD';
  // returns exit code 1 if there are changes
  // thus we reverse the true / false order
  return exec(cmd)
    .then(d3h.no, d3h.yes);
}
 
module.exports = hasChanges;