src/utils/branches.js
function update(repoState, driver, branchName) {
    branchName = Normalize.branchName(branchName || repoState.getCurrentBranch());

    return driver.fetchBranches()
    .then((branches) => {
        const newBranch = branches.find((branch) => {
            return branch.getFullName() === branchName;
        });

        if (!newBranch) {
            return repoState;
        } else {
            return RepoUtils.fetchTree(repoState, driver, newBranch);
        }
    });
}
function update(repoState, driver, branchName) {
    branchName = Normalize.branchName(branchName || repoState.getCurrentBranch());

    return driver.fetchBranches()
    .then((branches) => {
        const newBranch = branches.find((branch) => {
            return branch.getFullName() === branchName;
        });

        if (!newBranch) {
            return repoState;
        } else {
            return RepoUtils.fetchTree(repoState, driver, newBranch);
        }
    });
}
Fetch the list of branches, and update the given branch only. Will update
the WorkingState of the branch (and discard previous
@param {RepositoryState} repoState
@param {Driver} driver
@param {Branch | String} branchName The branch to update
@return {Promise<RepositoryState>} with the branch updated