|Re: [jgit-dev] Check for file changed|
Hello, Robin ! On Wed, Apr 18, 2012 at 9:57 PM, Robin Rosenberg <robin.rosenberg@xxxxxxxxxx> wrote: > Seems you have core.autocrlf. It's almost there in 1.3, but broken. Try > the nightly build if you want to use autocrlf. >> 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. > > jgit diff. Status is only an API this far. jgit 1.2 diff also reports about file modified, like git 1.2 status >> new Git(repository).status().call().getModified().contains(myFile). > If only creation time is changed, the file is not "modified", but if you Files are equals (I checked via binary diff). > checked it out with C Git with autocrlf=true and check status with JGit 1.2, > it will see it as changed because JGit doesn't normalize the input. JGit 2.0 > should behave differently (better) here. org.eclipse.jgit_18.104.22.168204181811.jar has the same invalid behavior(it reports "modified" from jgit diff and jgit status). BTW, jgit 2.0 diff produce exception when output stream not defined: java.lang.NullPointerException at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:141) at org.eclipse.jgit.diff.DiffFormatter.flush(DiffFormatter.java:373) at org.eclipse.jgit.api.DiffCommand.call(DiffCommand.java:151) WBR, Alex.
Back to the top