Skip to content

Commit 9446b1d

Browse files
author
John Haley
committed
Add defaults to Remote.prototype.push
Instead of forcing the user to pass in a signature and message each time they call push we can derive a good default for them.
1 parent 82abfdf commit 9446b1d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/remote.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ Remote.prototype.setCallbacks = function(callbacks) {
3535
*/
3636
Remote.prototype.push = function(refSpecs, options, signature, message) {
3737
options = normalizeOptions(options, NodeGit.PushOptions);
38+
signature = signature || this.owner().defaultSignature();
39+
message = message || 'Push to ' + this.name();
3840

3941
return push.call(this, refSpecs, options, signature, message);
4042
};

0 commit comments

Comments
 (0)