File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -279,8 +279,18 @@ define(['d3'], function () {
279
279
} ,
280
280
281
281
merge : function ( args ) {
282
+ var noFF = false ;
283
+ if ( args . length == 2 )
284
+ {
285
+ var mergeSwitch = args . pop ( ) ;
286
+ if ( mergeSwitch === '--no-ff' ) {
287
+ noFF = true ;
288
+ } else {
289
+ this . info ( 'This demo only supports the --no-ff switch..' ) ;
290
+ }
291
+ }
282
292
var ref = args . shift ( ) ,
283
- result = this . historyView . merge ( ref ) ;
293
+ result = this . historyView . merge ( ref , noFF ) ;
284
294
285
295
if ( result === 'Fast-Forward' ) {
286
296
this . info ( 'You have performed a fast-forward merge.' ) ;
Original file line number Diff line number Diff line change @@ -939,7 +939,7 @@ define(['d3'], function () {
939
939
}
940
940
} ,
941
941
942
- merge : function ( ref ) {
942
+ merge : function ( ref , noFF ) {
943
943
var mergeTarget = this . getCommit ( ref ) ,
944
944
currentCommit = this . getCommit ( 'HEAD' ) ;
945
945
@@ -951,7 +951,7 @@ define(['d3'], function () {
951
951
throw new Error ( 'Already up-to-date.' ) ;
952
952
} else if ( currentCommit . parent2 === mergeTarget . id ) {
953
953
throw new Error ( 'Already up-to-date.' ) ;
954
- } else if ( this . isAncestor ( currentCommit , mergeTarget ) ) {
954
+ } else if ( this . isAncestor ( currentCommit , mergeTarget ) && noFF !== true ) {
955
955
this . fastForward ( mergeTarget ) ;
956
956
return 'Fast-Forward' ;
957
957
} else {
You can’t perform that action at this time.
0 commit comments