aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java
diff options
context:
space:
mode:
authorMaik Schreiber <blizzy@blizzy.de>2014-06-19 12:54:14 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2014-07-30 16:20:08 +0200
commit7ff1e0d8f56dda85ba2a2224126a1075bda1bcf2 (patch)
tree53d7f37d3a5ba52402cc5213aa661d0a5e438d09 /org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java
parent7b0ee393ba1b5b99aa89c92bb841ef057c2aaa02 (diff)
downloadjgit-7ff1e0d8f56dda85ba2a2224126a1075bda1bcf2.tar.gz
jgit-7ff1e0d8f56dda85ba2a2224126a1075bda1bcf2.zip
Fix RevertCommand to correctly revert multiple commits at once.
The fix is to move the new head commit to the newly-created revert commit, so that additional revert commits will use the correct head. Change-Id: I5de3a9a2a4c276e60af732e9c507cbbdfd1a4652 Signed-off-by: Maik Schreiber <blizzy@blizzy.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java
index 52327d76c7..470d823aca 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java
@@ -186,6 +186,7 @@ public class RevertCommand extends GitCommand<RevCommit> {
.setMessage(newMessage)
.setReflogComment("revert: " + shortMessage).call(); //$NON-NLS-1$
revertedRefs.add(src);
+ headCommit = newHead;
} else {
unmergedPaths = merger.getUnmergedPaths();
Map<String, MergeFailureReason> failingPaths = merger