Skip to content

Commit 70b6e46

Browse files
committed
Normalize the remote push options
1 parent a963050 commit 70b6e46

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

lib/remote.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ var lookupWrapper = require("./util/lookupWrapper");
44

55
var Remote = NodeGit.Remote;
66
var setCallbacks = Remote.prototype.setCallbacks;
7+
var push = Remote.push;
78

89
/**
910
* Retrieves the remote by name
@@ -21,4 +22,21 @@ Remote.prototype.setCallbacks = function(callbacks) {
2122
return setCallbacks.call(this, callbacks);
2223
};
2324

25+
/**
26+
* Pushes to a remote
27+
*
28+
* @async
29+
* @param {Array} refSpecs The ref specs that should be pushed
30+
* @param {PushOptions} options Options for the checkout
31+
* @param {Signature} signature The identity to use for the reflog of the
32+
* updated references
33+
* @param {String} message The message to use for the update reflog messages
34+
* @return {Number} error code
35+
*/
36+
Remote.push = function(refSpecs, options, signature, message) {
37+
options = normalizeOptions(options, NodeGit.PushOptions);
38+
39+
return push.call(this, refSpecs, options, signature, message);
40+
};
41+
2442
module.exports = Remote;

0 commit comments

Comments
 (0)