Jgit untracked files and symlinks [message #1386020] |
Thu, 12 June 2014 22:10  |
Eclipse User |
|
|
|
I am developing a tool using Jgit and I would like it to output a list of untracked files. It successfully reports the untracked files, but it additionally reports many false positives. The false positives are all files whose path are of the form /a/b/symlink/c/file.txt. My guess is that to get the untracked files, it first looks recursivley at all the files in the top level directory (/a), then calls git ls-files to get all the files git knows about, and takes the difference. The remainder is what it reports as the untracked files. The problem is git ls-files doesn't report files of the form /a/b/symlink/c/file.txt, so the difference has some extra false positives in it that I don't want. Here is my code.
Git git = Git.open(workingDirectory);
Status status = git.status().call();
untracked = status.getUntracked(); //reports extra files
I think there is something I can do with a file filter? or something like that, where I can add a filter the git.status() method so that it only looks at paths that don't have a symlink in it. I remember seeing something similar to that a while ago but I can't find that example anymore.
In summary, how do I make my git.status().call().getUntracked() method call filter out all paths that have a symlink in it?
Thanks
|
|
|
|
Powered by
FUDForum. Page generated in 0.07991 seconds