Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Jgit untracked files and symlinks(Jgit reports files of the form /a/b/symlink/c/d as untracked)
Jgit untracked files and symlinks [message #1386020] Thu, 12 June 2014 22:10 Go to next message
Eclipse UserFriend
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
Re: Jgit untracked files and symlinks [message #1386210 is a reply to message #1386020] Sat, 14 June 2014 17:49 Go to previous message
Eclipse UserFriend
EGit/JGit live in http://www.eclipse.org/forums/index.php?t=thread&frm_id=48
Previous Topic:Strange error preventing running project on glassfish
Next Topic:Unable to save .java files
Goto Forum:
  


Current Time: Wed May 14 12:06:27 EDT 2025

Powered by FUDForum. Page generated in 0.07991 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top