public boolean matchesFile(VirtualFile file) { if (myType == IgnoreSettingsType.MASK) { myMatcher.reset(file.getName()); return myMatcher.matches(); } else { // quick check for 'file' == exact match pattern if (IgnoreSettingsType.FILE.equals(myType) && !StringUtil.equals(myFilenameIfFile, file.getNameSequence())) return false; VirtualFile selector = resolve(); if (Comparing.equal(selector, NullVirtualFile.INSTANCE)) return false; if (myType == IgnoreSettingsType.FILE) { return Comparing.equal(selector, file); } else { if ("./".equals(myPath)) { // special case for ignoring the project base dir (IDEADEV-16056) return !file.isDirectory() && Comparing.equal(file.getParent(), selector); } return VfsUtilCore.isAncestor(selector, file, false); } } }
public boolean matchesFile(VirtualFile file) { if (myType == IgnoreSettingsType.MASK) { myMatcher.reset(file.getName()); return myMatcher.matches(); } else { // quick check for 'file' == exact match pattern if (IgnoreSettingsType.FILE.equals(myType) && ! myFilenameIfFile.equals(file.getName())) return false; VirtualFile selector = resolve(); if (Comparing.equal(selector, NullVirtualFile.INSTANCE)) return false; if (myType == IgnoreSettingsType.FILE) { return Comparing.equal(selector, file); } else { if ("./".equals(myPath)) { // special case for ignoring the project base dir (IDEADEV-16056) return !file.isDirectory() && Comparing.equal(file.getParent(), selector); } return VfsUtil.isAncestor(selector, file, false); } } }
private VirtualFile resolve() { if (myCachedResolved == null) { VirtualFile resolved = doResolve(); myCachedResolved = resolved != null ? resolved : NullVirtualFile.INSTANCE; } return myCachedResolved; }
private GitHeavyCommit createNotLoadedCommit(AbstractHash shortHash) { final String notKnown = "Can not load"; return new GitHeavyCommit(NullVirtualFile.INSTANCE, shortHash, SHAHash.emulate(shortHash), notKnown, notKnown, new Date(0), notKnown, "Can not load details", Collections.<String>emptySet(), Collections.<FilePath>emptyList(), notKnown, notKnown, Collections.<String>emptyList(), Collections.<String>emptyList(), Collections.<String>emptyList(), Collections.<Change>emptyList(), 0); }
private static GitHeavyCommit mockCommit(String hash, String message) { AbstractHash ahash = AbstractHash.create(hash); List<Change> changes = new ArrayList<Change>(); changes.add(new Change(null, new MockContentRevision(new FilePathImpl(new MockVirtualFile("name")), VcsRevisionNumber.NULL))); return new GitHeavyCommit(NullVirtualFile.INSTANCE, ahash, SHAHash.emulate(ahash), "John Smith", null, null, message, message, null, null, null, null, null, null, null, changes, 0); }