I am using JGit API (https://www.eclipse.org/jgit/) to access a git repository.
In the git repository, I am storing .txt files and other file formats also. I ran into a requirement where I should get the diff of only .txt files.
Basically I am trying to achieve the equivalent of
git diff master HEAD -- '*.txt'
How to filter git diff based on file extensions? using JGit API.
From this answer, (Equivalent of git diff in JGit) I understood how to get the normal diff. But I would like to add the file extension restriction to that but I could not see anything in the DiffCommand
doc (https://download.eclipse.org/jgit/site/5.2.0.201812061821-r/apidocs/index.html).
Could some one please give some pointer?