simple-git
Advanced tools
Comparing version 0.5.0 to 0.6.0
{ | ||
"name": "simple-git", | ||
"description": "Simple GIT interface for node.js", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"author": "Steve King <steve@mydev.co>", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -28,2 +28,6 @@ # Simple Git | ||
`.diff(options, handlerFn)` get the diff of the current repo compared to the last commit with a set of options supplied as a string | ||
`.diff(handlerFn)` get the diff for all file in the current repo compared to the last commit | ||
`.pull(remote, branch, handlerFn)` pull all updates from the repo ('origin'/'master') | ||
@@ -30,0 +34,0 @@ |
@@ -253,2 +253,24 @@ (function() { | ||
/** | ||
* Return repository changes. | ||
* | ||
* @param {String} [options] | ||
* @param {Function} [then] | ||
*/ | ||
Git.prototype.diff = function(options, then) { | ||
var command = 'git diff'; | ||
if (typeof options === 'string' && typeof then === 'function') { | ||
command += ' ' + options; | ||
} | ||
if (typeof arguments[arguments.length - 1] === 'function') { | ||
then = arguments[arguments.length - 1]; | ||
} | ||
return this._run(command, function(err, data) { | ||
then && then(err, data); | ||
}); | ||
}; | ||
Git.prototype._rm = function(files, options, then) { | ||
@@ -255,0 +277,0 @@ return this._run('git rm ' + options + ' "' + [].concat(files).join('" "') + '"', function(err) { |
16410
375
92