Skip to content

Commit

Permalink
Show outgoing commits when a repo is initialized and new remote is added
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonbrandys committed Jan 26, 2012
1 parent 1fa61e6 commit fb8e102
Showing 1 changed file with 19 additions and 2 deletions.
Expand Up @@ -458,7 +458,7 @@ exports.GitRepositoryExplorer = (function() {
);
};

GitRepositoryExplorer.prototype.displayRemoteBranches2 = function(remotes, repository, deferred){
GitRepositoryExplorer.prototype.displayRemoteBranches2 = function(remotes, repository, deferred, anyRemoteBranch){
var that = this;
if (deferred == null)
deferred = new dojo.Deferred();
Expand All @@ -471,12 +471,16 @@ exports.GitRepositoryExplorer = (function() {
remoteBranches[i].Repository = repository;
that.renderRemoteBranch(remoteBranches[i], i);
}
that.displayRemoteBranches2(remotes.slice(1), repository, deferred);
that.displayRemoteBranches2(remotes.slice(1), repository, deferred, (anyRemoteBranch || (remoteBranches.length > 0)));
}, function () {

}
);
} else {
if (!anyRemoteBranch){
dojo.style(dojo.byId("remoteBranchSectionProgress"), "visibility", "hidden");
dojo.byId("remoteBranchHeader").innerHTML = "No Remote Branches";
}
deferred.callback();
}

Expand Down Expand Up @@ -585,6 +589,19 @@ exports.GitRepositoryExplorer = (function() {
);
}
);
} else {
that.registry.getService("orion.git.provider").doGitLog(currentBranch.CommitLocation + "?page=1&pageSize=20",
function(resp){
dojo.style(dojo.byId("commitSectionProgress"), "visibility", "hidden");

for (var i=0; i<resp.Children.length; i++){
that.renderCommit(resp.Children[i], false, i);
}

if (resp.Children.length == 0)
that.renderNoCommit();
}
);
}
}
);
Expand Down

0 comments on commit fb8e102

Please sign in to comment.