]> source.dussan.org Git - jgit.git/commit
Ignore empty lines when parsing git-rebase-todo 37/6237/2
authorRobin Stocker <robin@nibor.org>
Mon, 4 Jun 2012 13:35:16 +0000 (15:35 +0200)
committerRobin Stocker <robin@nibor.org>
Sat, 23 Jun 2012 14:38:54 +0000 (16:38 +0200)
commit14ff22fd74e1720e9d8988c9d58653dd177f6fb6
tree2380d7d4e66467ec62eb2b88dfb7a272cf63c886
parent3c29bf094111308da2cea79fc36af1eff2f4da7a
Ignore empty lines when parsing git-rebase-todo

When starting a rebase with C Git, there may be empty lines in the
git-rebase-todo file. Before this change, JGit would fail to parse the
file with e.g. the following exception:

  JGitInternalException: Unknown or unsupported command "
  #", only "pick" is allowed.

This happened when there was an empty line just before the comments,
because the nextSpace would be the one from the comment. Now the empty
lines are ignored by checking for nextSpace < ptr outside of the loop.

Change-Id: I94ad299f367c846e7729c74f49c6b8f93f75ae81
Signed-off-by: Robin Stocker <robin@nibor.org>
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java
org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java