Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions js/historyview.js
Original file line number Diff line number Diff line change
Expand Up @@ -1416,15 +1416,21 @@ define(['d3'], function() {
throw new Error('Already up-to-date.');
} else if (noFF === true) {
var branchStartCommit = this.getCommit(mergeTarget.parent);
Copy link

@udovicic udovicic Nov 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing this, and following lines with:

var branchStartCommit = this.getCommit(mergeTarget.id);
var base = (currentCommit.isNoFFCommit === true) ? currentCommit.parent2 : null;

while (branchStartCommit.parent !== base && branchStartCommit.parent !== currentCommit.id) {
  branchStartCommit = this.getCommit(branchStartCommit.parent);
}

will fix several issues, but unfortunately still does not work as expected in some edge cases. Hope this helps

while (branchStartCommit.parent !== currentCommit.id) {
branchStartCommit = this.getCommit(branchStartCommit.parent);
console.dir(currentCommit);
console.dir(branchStartCommit);
if (branchStartCommit !== currentCommit) {
while (branchStartCommit.parent !== currentCommit.id) {
branchStartCommit = this.getCommit(branchStartCommit.parent);
console.dir(branchStartCommit);
}
}

branchStartCommit.isNoFFBranch = true;
branchStartCommit.isNoFFBranch = false;

console.dir(mergeTarget);
this.commit({
parent2: mergeTarget.id,
isNoFFCommit: true
// isNoFFCommit: true
}, 'Merge');
} else if (this.isAncestorOf(currentCommit.id, mergeTarget.id)) {
this.fastForward(mergeTarget);
Expand Down