0

I'm trying to complete/continue a rebase (after it was stopped by JGit due to conflicts and after I resolved the conflicts and committed the changes) using the JGit library; but the command does not seem to have any effect. The repository remains in the "in progress" state

Git git = Git.open(new File("D:\\myDir"));
RebaseCommand rebaseCommand = git.rebase();
rebaseCommand.setUpstream("branch1"); //Have tried without this statement as well
rebaseCommand.setOperation(Operation.CONTINUE);
rebaseCommand.setPreserveMerges(false); //Have tried without this statement as well
rebaseCommand.call();

FYI... every other JGit command that I run (e.g. checkout, commit, push etc.) via JGit runs fine. I'm using JGit version 4.3.1.201605051710-r

Has anyone else run into this problem and would someone know the solution to this?

Rüdiger Herrmann
  • 20,512
  • 11
  • 62
  • 79
  • What does `call()` return and what is the expected outcome? – Rüdiger Herrmann Jun 15 '16 at 09:21
  • call() returns the status as Status.NOTHING_TO_COMMIT. While the status is not incorrect, I would have expected it to return Status.OK. However, I'm not too concerned about the status returned by the command. I would expect the command to do exactly what rebase --continue does, i.e. complete the rebase; which is not happening. When I view the status of the repository via the command line, I see that the rebase is still in progress. – AshokaK Jun 16 '16 at 13:23
  • I would indeed be concerned about the return value. As long as it isn't `OK`, rebase clearly doesn't work. Did you try to debug-step through the `call()` method to see what leads to the `NOTHING_TO_COMMIT` result? – Rüdiger Herrmann Jun 16 '16 at 14:02

1 Answers1

0

You can continue the rebase successfully after RebaseResult.Status.NOTHING_TO_COMMIT if you execute git.rebase().setOperation(Operation.SKIP).call().

TT.
  • 15,774
  • 6
  • 47
  • 88