summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorChristian Halstrick <christian.halstrick@sap.com>2014-10-17 10:05:32 +0200
committerStefan Lay <stefan.lay@sap.com>2014-11-03 04:32:54 -0500
commit6f0b92ff22ff58a4c8eb9de8d9b3281d77852070 (patch)
tree619b193756c8533befb32a2f4dce90cddbde5edf /org.eclipse.jgit
parent95172dea173425697814e3ba0b4eb823301bf7d0 (diff)
downloadjgit-6f0b92ff22ff58a4c8eb9de8d9b3281d77852070.tar.gz
jgit-6f0b92ff22ff58a4c8eb9de8d9b3281d77852070.zip
RebaseCommand should ignore submodule modifications
Before a rebase happens the RebaseCommand checks that the working tree is clean. We don't want to start a rebase on a dirty working tree. If the working tree is dirty a rebase should not be allowed. But RebaseCommand should ignore modifications done to submodules. E.g. if a submodules HEAD points to <x> but the root repository has in index that the submodule should point to <y> then this should not prohibit a rebase. Also native git allows a rebase in this case. Since jgit's StatusCommand has learned to ignore submodule changes this is now used by the RebaseCommand to determine the repository state correctly. Bug: 446922 Change-Id: I487bf7484dca3f5501e6e514584e2871524eea19
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java
index 7cc682e6b5..47424a9074 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java
@@ -99,6 +99,7 @@ import org.eclipse.jgit.merge.MergeStrategy;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.revwalk.filter.RevFilter;
+import org.eclipse.jgit.submodule.SubmoduleWalk.IgnoreSubmoduleMode;
import org.eclipse.jgit.treewalk.TreeWalk;
import org.eclipse.jgit.treewalk.filter.TreeFilter;
import org.eclipse.jgit.util.FileUtils;
@@ -294,7 +295,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
walk.parseCommit(repo.resolve(Constants.HEAD)),
upstreamCommit)) {
org.eclipse.jgit.api.Status status = Git.wrap(repo)
- .status().call();
+ .status().setIgnoreSubmodules(IgnoreSubmoduleMode.ALL).call();
if (status.hasUncommittedChanges()) {
List<String> list = new ArrayList<String>();
list.addAll(status.getUncommittedChanges());