Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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] Fri, 13 June 2014 02:10 Go to next message
Evan Thomas is currently offline Evan ThomasFriend
Messages: 4
Registered: June 2014
Junior Member
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 21:49 Go to previous message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
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: Fri Jun 21 03:55:23 GMT 2024

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

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

Back to the top