File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,13 @@ define(['d3'], function () {
92
92
}
93
93
94
94
branchIndex = branches . indexOf ( commit . id ) ;
95
+
96
+ if ( commit . isNoFFBranch === true ) {
97
+ branchIndex ++ ;
98
+ }
99
+ if ( commit . isNoFFCommit === true ) {
100
+ branchIndex -- ;
101
+ }
95
102
96
103
if ( parentCY === baseLine ) {
97
104
var direction = 1 ;
@@ -951,7 +958,16 @@ define(['d3'], function () {
951
958
throw new Error ( 'Already up-to-date.' ) ;
952
959
} else if ( currentCommit . parent2 === mergeTarget . id ) {
953
960
throw new Error ( 'Already up-to-date.' ) ;
954
- } else if ( this . isAncestor ( currentCommit , mergeTarget ) && noFF !== true ) {
961
+ } else if ( noFF === true ) {
962
+ var branchStartCommit = this . getCommit ( mergeTarget . parent ) ;
963
+ while ( branchStartCommit . parent !== currentCommit . id ) {
964
+ branchStartCommit = this . getCommit ( branchStartCommit . parent ) ;
965
+ }
966
+
967
+ branchStartCommit . isNoFFBranch = true ;
968
+
969
+ this . commit ( { parent2 : mergeTarget . id , isNoFFCommit : true } ) ;
970
+ } else if ( this . isAncestor ( currentCommit , mergeTarget ) ) {
955
971
this . fastForward ( mergeTarget ) ;
956
972
return 'Fast-Forward' ;
957
973
} else {
You can’t perform that action at this time.
0 commit comments