diff options
author | James Moger <james.moger@gitblit.com> | 2014-03-06 14:32:08 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-03-06 14:32:08 -0500 |
commit | d2ab7a68e4c3f1e619af3576e1443afa2f98cdfd (patch) | |
tree | 78c89b4d30a0fb47e8fb1601f54918231f2e9d67 | |
parent | b8633f8a62b4f605de0b0c035d2cf29b89164029 (diff) | |
download | gitblit-d2ab7a68e4c3f1e619af3576e1443afa2f98cdfd.tar.gz gitblit-d2ab7a68e4c3f1e619af3576e1443afa2f98cdfd.zip |
Fixed bug in merge: improper use of force and failing on FORCED result
-rw-r--r-- | src/main/java/com/gitblit/utils/JGitUtils.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/com/gitblit/utils/JGitUtils.java b/src/main/java/com/gitblit/utils/JGitUtils.java index 6f3b0856..c6526c28 100644 --- a/src/main/java/com/gitblit/utils/JGitUtils.java +++ b/src/main/java/com/gitblit/utils/JGitUtils.java @@ -59,8 +59,8 @@ import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.RepositoryCache.FileKey;
import org.eclipse.jgit.lib.StoredConfig;
import org.eclipse.jgit.lib.TreeFormatter;
-import org.eclipse.jgit.merge.MergeStrategy; -import org.eclipse.jgit.merge.RecursiveMerger; +import org.eclipse.jgit.merge.MergeStrategy;
+import org.eclipse.jgit.merge.RecursiveMerger;
import org.eclipse.jgit.revwalk.RevBlob;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevObject;
@@ -84,7 +84,7 @@ import org.eclipse.jgit.util.FS; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.gitblit.GitBlitException; +import com.gitblit.GitBlitException;
import com.gitblit.models.GitNote;
import com.gitblit.models.PathModel;
import com.gitblit.models.PathModel.PathChangeModel;
@@ -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;
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())); |