Skip to content

Commit

Permalink
lib/branch.js: async/await
Browse files Browse the repository at this point in the history
  • Loading branch information
samuela committed Oct 17, 2021
1 parent e099639 commit 946b0d2
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/branch.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var NodeGit = require("../");
var Branch = NodeGit.Branch;
const NodeGit = require("../");
const Branch = NodeGit.Branch;

var _remoteName = Branch.remoteName;
const _remoteName = Branch.remoteName;

/**
* Retrieve the Branch's Remote Name as a String.
Expand All @@ -11,9 +11,7 @@ var _remoteName = Branch.remoteName;
* @param {String} the refname of the branch
* @return {String} remote name as a string.
*/
Branch.remoteName = function(repo, remoteRef) {
return _remoteName.call(this, repo, remoteRef)
.then(function(remoteNameBuffer) {
return remoteNameBuffer.toString();
});
Branch.remoteName = async function (repo, remoteRef) {
const remoteNameBuffer = await _remoteName.call(this, repo, remoteRef);
return remoteNameBuffer.toString();
};

0 comments on commit 946b0d2

Please sign in to comment.