I have list of path of new created/updated files that I want to add through JGit, but I have an issue while adding all those change file in the staging area.
With this syntax, I am not able to see these files in my commit:
final Git openedRepo = Git.open(gitFile);
for (String i : listOffile) {
openedRepo.add().addFilepattern(i).call();
}
But when I use the below syntax, I am able to see all changes and created files in my commit:
final Git openedRepo = Git.open(gitFile);
openedRepo.add().addFilepattern(".").call();
Note: I am able to see files in my listOffile
while logging.
Is there is any mistake with my first syntax/code?