In order to detect whether someone else has modified a file named "myfile.txt" and pushed it to origin/master, I do type on terminal
git fetch
git diff --quiet origin/master myfile.txt
The exit status tells me whether the file has been modified by someone else or not and this works great.
Now, I want to do the same but using jgit, on a java program. Fetch is not a problem but i can't find how to specify a branch (origin/master) and specific file (myfile.txt) to the jgit.diff request.
Is it possible to do this ?