Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] Check for file changed

Hi, All !

I'm trying to use jgit in my project for access to git repository.

There is strange behavior with version 1.2.0 (I can't use 1.3.0 since
it say "EOFException: Input did not match supplied length. 139596
bytes are missing. " on my "add" command).

My scenario is:
1. Checkout project into some branch
2. Modify one file, or just override it without changes.
3. Check for file changed
4. "add", then "commit" only if file changed

Sometimes file is not really changed, but just overrided. So, only
creation date/time of this file changed. After that, my file exist in

new Git(repository).status().call().getModified().contains(myFile).

If I try to run "git status" from command line before step 3, then my
file will not be in getModified() collection.

I can't use Status.getChanged(), because it doesn't contains my file
all the time.

So, questions are:
1) is it bug in jgit ?
2) How can I check file change by content, like command-line git ? I'm
using core.autocrlf=true on WIndows computer, if it important.

WBR, Alex.

Back to the top