Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
JGit/User Guide
< JGit
Revision as of 17:43, 24 March 2010 by Unnamed Poltroon (Talk) (New page: ==How do I know if a file is under version control?== <source lang="java"> private boolean isVersionControlled(IResource resource) { RepositoryMapping mapping = RepositoryMapping.getMapp...)
How do I know if a file is under version control?
private boolean isVersionControlled(IResource resource) { RepositoryMapping mapping = RepositoryMapping.getMapping(resource); Repository repository = mapping.getRepository(); String gitPath = mapping.getRepoRelativePath(resource); DirCache cache = DirCache.read(repository); return cache.getEntry(gitPath) != null; }