Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions generate/input/descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -3300,6 +3300,11 @@
},
"git_remote_update_tips": {
"isAsync": true,
"args": {
"reflog_message": {
"isOptional": true
}
},
"return": {
"isErrorCode": true
}
Expand Down
36 changes: 35 additions & 1 deletion lib/remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ var _createWithOpts = Remote.createWithOpts;
var _download = Remote.prototype.download;
var _fetch = Remote.prototype.fetch;
var _push = Remote.prototype.push;
var _updateTips = Remote.prototype.updateTips;
var _upload = Remote.prototype.upload;

/**
Expand Down Expand Up @@ -146,6 +147,40 @@ Remote.prototype.fetch = function(refspecs, opts, reflog_message) {
.call(this, refspecs, normalizeFetchOptions(opts), reflog_message);
};

/**
* Update the tips to the new state
* @param {RemoteCallbacks} callbacks The callback functions for the connection
* @param {boolean} updateFetchhead whether to write to FETCH_HEAD. Pass true
* to behave like git.
* @param {boolean} downloadTags what the behaviour for downloading tags is
* for this fetch. This is ignored for push.
* This must be the same value passed to
* Remote.prototype.download
* @param {string} reflogMessage The message to insert into the reflogs. If
* null and fetching, the default is "fetch ",
* where is the name of the remote (or its url,
* for in-memory remotes). This parameter is
* ignored when pushing.
*/
Remote.prototype.updateTips = function(
callbacks,
updateFetchhead,
downloadTags,
reflogMessage
) {
if (callbacks) {
callbacks = normalizeOptions(callbacks, NodeGit.RemoteCallbacks);
}

return _updateTips.call(
this,
callbacks,
updateFetchhead,
downloadTags,
reflogMessage
);
};

/**
* Pushes to a remote
*
Expand Down Expand Up @@ -184,7 +219,6 @@ Remote.prototype.upload = function(refSpecs, opts) {
return _upload.call(this, refSpecs, opts);
};


NodeGit.Remote.COMPLETION_TYPE = {};
var DEPRECATED_STATES = {
COMPLETION_DOWNLOAD: "DOWNLOAD",
Expand Down