Browse Source

Rebase Interoperability first part: write "interactive" file

The Repository is then in state "Rebase interactive".

Change-Id: I5d2de57f8670e1d4c71ed22509ab17f04e2561b5
Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
stable-0.10
Mathias Kinzler 14 years ago
parent
commit
7aa1b85821
  1. 6
      org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java
  2. 1
      org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java

6
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java

@ -322,7 +322,8 @@ public class RebaseCommandTest extends RepositoryTestCase {
checkFile(theFile, checkFile(theFile,
"<<<<<<< OURS\n1master\n=======\n1topic\n>>>>>>> THEIRS\n2\n3\ntopic4\n"); "<<<<<<< OURS\n1master\n=======\n1topic\n>>>>>>> THEIRS\n2\n3\ntopic4\n");
assertEquals(RepositoryState.REBASING_MERGE, db.getRepositoryState()); assertEquals(RepositoryState.REBASING_INTERACTIVE, db
.getRepositoryState());
assertTrue(new File(db.getDirectory(), "rebase-merge").exists()); assertTrue(new File(db.getDirectory(), "rebase-merge").exists());
// the first one should be included, so we should have left two picks in // the first one should be included, so we should have left two picks in
// the file // the file
@ -410,7 +411,8 @@ public class RebaseCommandTest extends RepositoryTestCase {
assertEquals(Status.STOPPED, res.getStatus()); assertEquals(Status.STOPPED, res.getStatus());
assertEquals(conflicting, res.getCurrentCommit()); assertEquals(conflicting, res.getCurrentCommit());
assertEquals(RepositoryState.REBASING_MERGE, db.getRepositoryState()); assertEquals(RepositoryState.REBASING_INTERACTIVE, db
.getRepositoryState());
assertTrue(new File(db.getDirectory(), "rebase-merge").exists()); assertTrue(new File(db.getDirectory(), "rebase-merge").exists());
// the first one should be included, so we should have left two picks in // the first one should be included, so we should have left two picks in
// the file // the file

1
org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java

@ -325,6 +325,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
createFile(rebaseDir, "head", headId.name()); createFile(rebaseDir, "head", headId.name());
createFile(rebaseDir, "head-name", headName); createFile(rebaseDir, "head-name", headName);
createFile(rebaseDir, "onto", upstreamCommit.name()); createFile(rebaseDir, "onto", upstreamCommit.name());
createFile(rebaseDir, "interactive", "");
BufferedWriter fw = new BufferedWriter(new OutputStreamWriter( BufferedWriter fw = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(new File(rebaseDir, "git-rebase-todo")), new FileOutputStream(new File(rebaseDir, "git-rebase-todo")),
"UTF-8")); "UTF-8"));

Loading…
Cancel
Save