@Test
public void branchChangedLines_should_be_correct_when_change_is_not_committed() throws GitAPIException, IOException {

  String fileName = "file-in-first-commit.xoo";
  git.branchCreate().setName("b1").call();
  git.checkout().setName("b1").call();
  // this line is committed
  addLineToFile(fileName, 3);
  commit(fileName);
  // this line is not committed
  addLineToFile(fileName, 1);
  Path filePath = worktree.resolve(fileName);
  Map<Path, Set<Integer>> changedLines = newScmProvider().branchChangedLines("master", worktree, Collections.singleton(filePath));
  // both lines appear correctly
  assertThat(changedLines).containsExactly(entry(filePath, new HashSet<>(Arrays.asList(1, 4))));
}