]> source.dussan.org Git - gitblit.git/commitdiff
Fixed bug in merge: improper use of force and failing on FORCED result
authorJames Moger <james.moger@gitblit.com>
Thu, 6 Mar 2014 19:32:08 +0000 (14:32 -0500)
committerJames Moger <james.moger@gitblit.com>
Thu, 6 Mar 2014 19:32:08 +0000 (14:32 -0500)
src/main/java/com/gitblit/utils/JGitUtils.java

index 6f3b08560fd8858fe90001701805c09b72c758d7..c6526c28a1eebff89e1ae5924319dad778638ac2 100644 (file)
@@ -59,8 +59,8 @@ import org.eclipse.jgit.lib.Repository;
 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
@@ -84,7 +84,7 @@ import org.eclipse.jgit.util.FS;
 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
@@ -2329,11 +2329,11 @@ public class JGitUtils {
                                        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()));