diff --git a/src/main.js b/src/main.js index 94eb016c..7116d7b7 100644 --- a/src/main.js +++ b/src/main.js @@ -58,7 +58,7 @@ $(document).ready(function(){ setTimeout(windowResize, 50); setTimeout(function() { - events.trigger('submitCommandValueFromEvent', "gc; gc; gc; gc; gc; gc; git checkout master^^^^; git commit; git checkout -b another; gc; gc; git rebase master"); + events.trigger('submitCommandValueFromEvent', "gc; git checkout HEAD~1; git commit; git checkout -b bugFix; gc; gc; git rebase master; git checkout master; gc; gc; git merge bugFix"); }, 500); }); diff --git a/src/tree.js b/src/tree.js index 84a4161f..d2980769 100644 --- a/src/tree.js +++ b/src/tree.js @@ -426,6 +426,11 @@ var VisNode = Backbone.Model.extend({ this.set('outgoingEdges', []); }, + setDepth: function(depth) { + // for merge commits we need to max the depths across all + this.set('depth', Math.max(this.get('depth') || 0, depth)); + }, + setDepthBasedOn: function(depthIncrement) { if (this.get('depth') === undefined) { throw new Error('no depth yet!'); diff --git a/src/visuals.js b/src/visuals.js index 794029c4..50d0ae13 100644 --- a/src/visuals.js +++ b/src/visuals.js @@ -374,7 +374,7 @@ GitVisuals.prototype.getDepthIncrement = function(maxDepth) { }; GitVisuals.prototype.calcDepthRecursive = function(commit, depth) { - commit.get('visNode').set('depth', depth); + commit.get('visNode').setDepth(depth); var children = commit.get('children'); var maxDepth = depth;