From b60056f960c6f33b1341d41eb0eeea5ea7aff441 Mon Sep 17 00:00:00 2001 From: joshaber Date: Thu, 3 Dec 2015 11:34:05 -0500 Subject: [PATCH] Added .getUpstreamBranch --- src/git-repository-async.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/git-repository-async.js b/src/git-repository-async.js index c6d85943a..8bdb8ca22 100644 --- a/src/git-repository-async.js +++ b/src/git-repository-async.js @@ -251,9 +251,12 @@ export default class GitRepositoryAsync { // * `path` An optional {String} path in the repo to get this information for, // only needed if the repository contains submodules. // - // Returns a {String} branch name such as `refs/remotes/origin/master`. + // Returns a {Promise} which resolves to a {String} branch name such as + // `refs/remotes/origin/master`. getUpstreamBranch (_path) { - throw new Error('Unimplemented') + return this._getRepo(_path) + .then(repo => repo.getCurrentBranch()) + .then(branch => Git.Branch.upstream(branch)) } // Public: Gets all the local and remote references.