Skip to content

Commit

Permalink
Made no-ff look nice in graph
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeGinnivan committed Feb 14, 2015
1 parent fc69b17 commit 14a9d40
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion js/historyview.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ define(['d3'], function () {
}

branchIndex = branches.indexOf(commit.id);

if (commit.isNoFFBranch === true) {
branchIndex++;
}
if (commit.isNoFFCommit === true) {
branchIndex--;
}

if (parentCY === baseLine) {
var direction = 1;
Expand Down Expand Up @@ -951,7 +958,16 @@ define(['d3'], function () {
throw new Error('Already up-to-date.');
} else if (currentCommit.parent2 === mergeTarget.id) {
throw new Error('Already up-to-date.');
} else if (this.isAncestor(currentCommit, mergeTarget) && noFF !== true) {
} else if (noFF === true) {
var branchStartCommit = this.getCommit(mergeTarget.parent);
while (branchStartCommit.parent !== currentCommit.id) {
branchStartCommit = this.getCommit(branchStartCommit.parent);
}

branchStartCommit.isNoFFBranch = true;

this.commit({parent2: mergeTarget.id, isNoFFCommit: true});
} else if (this.isAncestor(currentCommit, mergeTarget)) {
this.fastForward(mergeTarget);
return 'Fast-Forward';
} else {
Expand Down

0 comments on commit 14a9d40

Please sign in to comment.