import org.eclipse.jgit.lib.RepositoryCache.FileKey;\r
import org.eclipse.jgit.lib.StoredConfig;\r
import org.eclipse.jgit.lib.TreeFormatter;\r
-import org.eclipse.jgit.merge.MergeStrategy;
-import org.eclipse.jgit.merge.RecursiveMerger;
+import org.eclipse.jgit.merge.MergeStrategy;\r
+import org.eclipse.jgit.merge.RecursiveMerger;\r
import org.eclipse.jgit.revwalk.RevBlob;\r
import org.eclipse.jgit.revwalk.RevCommit;\r
import org.eclipse.jgit.revwalk.RevObject;\r
import org.slf4j.Logger;\r
import org.slf4j.LoggerFactory;\r
\r
-import com.gitblit.GitBlitException;
+import com.gitblit.GitBlitException;\r
import com.gitblit.models.GitNote;\r
import com.gitblit.models.PathModel;\r
import com.gitblit.models.PathModel.PathChangeModel;\r
RefUpdate mergeRefUpdate = repository.updateRef(toBranch);
mergeRefUpdate.setNewObjectId(mergeCommitId);
mergeRefUpdate.setRefLogMessage("commit: " + mergeCommit.getShortMessage(), false);
- RefUpdate.Result rc = mergeRefUpdate.forceUpdate();
+ RefUpdate.Result rc = mergeRefUpdate.update();
switch (rc) {
case FAST_FORWARD:
// successful, clean merge
- break;
+ break;\r
default:
throw new GitBlitException(MessageFormat.format("Unexpected result \"{0}\" when merging commit {1} into {2} in {3}",
rc.name(), srcTip.getName(), branchTip.getName(), repository.getDirectory()));