@ -1,6 +1,7 @@
/ *
/ *
* Copyright ( C ) 2010 , Christian Halstrick < christian . halstrick @sap.com >
* Copyright ( C ) 2010 , Christian Halstrick < christian . halstrick @sap.com >
* Copyright ( C ) 2010 - 2014 , Stefan Lay < stefan . lay @sap.com >
* Copyright ( C ) 2010 - 2014 , Stefan Lay < stefan . lay @sap.com >
* Copyright ( C ) 2016 , Laurent Delaigue < laurent . delaigue @obeo.fr >
* and other copyright owners as documented in the project ' s IP log .
* and other copyright owners as documented in the project ' s IP log .
*
*
* This program and the accompanying materials are made available
* This program and the accompanying materials are made available
@ -65,8 +66,10 @@ import org.eclipse.jgit.internal.JGitText;
import org.eclipse.jgit.lib.AnyObjectId ;
import org.eclipse.jgit.lib.AnyObjectId ;
import org.eclipse.jgit.lib.Config.ConfigEnum ;
import org.eclipse.jgit.lib.Config.ConfigEnum ;
import org.eclipse.jgit.lib.Constants ;
import org.eclipse.jgit.lib.Constants ;
import org.eclipse.jgit.lib.NullProgressMonitor ;
import org.eclipse.jgit.lib.ObjectId ;
import org.eclipse.jgit.lib.ObjectId ;
import org.eclipse.jgit.lib.ObjectIdRef ;
import org.eclipse.jgit.lib.ObjectIdRef ;
import org.eclipse.jgit.lib.ProgressMonitor ;
import org.eclipse.jgit.lib.Ref ;
import org.eclipse.jgit.lib.Ref ;
import org.eclipse.jgit.lib.Ref.Storage ;
import org.eclipse.jgit.lib.Ref.Storage ;
import org.eclipse.jgit.lib.RefUpdate ;
import org.eclipse.jgit.lib.RefUpdate ;
@ -106,6 +109,8 @@ public class MergeCommand extends GitCommand<MergeResult> {
private String message ;
private String message ;
private ProgressMonitor monitor = NullProgressMonitor . INSTANCE ;
/ * *
/ * *
* The modes available for fast forward merges corresponding to the
* The modes available for fast forward merges corresponding to the
* < code > - - ff < / code > , < code > - - no - ff < / code > and < code > - - ff - only < / code >
* < code > - - ff < / code > , < code > - - no - ff < / code > and < code > - - ff - only < / code >
@ -330,6 +335,7 @@ public class MergeCommand extends GitCommand<MergeResult> {
repo . writeSquashCommitMsg ( squashMessage ) ;
repo . writeSquashCommitMsg ( squashMessage ) ;
}
}
Merger merger = mergeStrategy . newMerger ( repo ) ;
Merger merger = mergeStrategy . newMerger ( repo ) ;
merger . setProgressMonitor ( monitor ) ;
boolean noProblems ;
boolean noProblems ;
Map < String , org . eclipse . jgit . merge . MergeResult < ? > > lowLevelResults = null ;
Map < String , org . eclipse . jgit . merge . MergeResult < ? > > lowLevelResults = null ;
Map < String , MergeFailureReason > failingPaths = null ;
Map < String , MergeFailureReason > failingPaths = null ;
@ -586,4 +592,23 @@ public class MergeCommand extends GitCommand<MergeResult> {
this . message = message ;
this . message = message ;
return this ;
return this ;
}
}
/ * *
* The progress monitor associated with the diff operation . By default , this
* is set to < code > NullProgressMonitor < / code >
*
* @see NullProgressMonitor
*
* @param monitor
* A progress monitor
* @return this instance
* @since 4 . 2
* /
public MergeCommand setProgressMonitor ( ProgressMonitor monitor ) {
if ( monitor = = null ) {
monitor = NullProgressMonitor . INSTANCE ;
}
this . monitor = monitor ;
return this ;
}
}
}