got tags making commits not faded out or orphaned anymore

This commit is contained in:
Peter Cottle 2013-11-01 10:01:13 -07:00
parent e9e2cda241
commit 9fbe654cb2
3 changed files with 37 additions and 22 deletions

View file

@ -1747,6 +1747,14 @@ GitEngine.prototype.pruneTree = function() {
};
GitEngine.prototype.getUpstreamBranchSet = function() {
return this.getUpstreamCollectionSet(this.branchCollection);
};
GitEngine.prototype.getUpstreamTagSet = function() {
return this.getUpstreamCollectionSet(this.tagCollection);
};
GitEngine.prototype.getUpstreamCollectionSet = function(collection) {
// this is expensive!! so only call once in a while
var commitToSet = {};
@ -1775,16 +1783,16 @@ GitEngine.prototype.getUpstreamBranchSet = function() {
return set;
};
this.branchCollection.each(function(branch) {
var set = bfsSearch(branch.get('target'));
collection.each(function(ref) {
var set = bfsSearch(ref.get('target'));
_.each(set, function(id) {
commitToSet[id] = commitToSet[id] || [];
// only add it if it's not there, so hue blending is ok
if (!inArray(commitToSet[id], branch.get('id'))) {
if (!inArray(commitToSet[id], ref.get('id'))) {
commitToSet[id].push({
obj: branch,
id: branch.get('id')
obj: ref,
id: ref.get('id')
});
}
});