public class AddFile {
public static void main(String[] args) throws IOException, GitAPIException {
try (Repository repository = CookbookHelper.createNewRepository()) {
try (Git git = new Git(repository)) {
File myfile = new File(repository.getDirectory().getParent(), "testfile");
<BUG>myfile.createNewFile();

git.add()</BUG>
.addFilepattern("testfile")
.call();

public class AddFile {
public static void main(String[] args) throws IOException, GitAPIException {
try (Repository repository = CookbookHelper.createNewRepository()) {
try (Git git = new Git(repository)) {
File myfile = new File(repository.getDirectory().getParent(), "testfile");
if(!myfile.createNewFile()) {
throw new IOException("Could not create file " + myfile);
}
git.add()
.addFilepattern("testfile")
.call();
