public static boolean isIgnored(File file, boolean checkSharability) { if (file == null) { return false; } File topFile = Git.getInstance().getTopmostManagedParent(file); // We assume that the toplevel directory should not be ignored. if (topFile == null || topFile.equals(file)) { return false; // We assume that the Project should not be ignored. } if (file.isDirectory()) { ProjectManager projectManager = ProjectManager.getDefault(); if (projectManager.isProject(FileUtil.toFileObject(file))) { return false; } } Repository repo = Git.getInstance().getRepository(topFile); ExcludeCache cache = getCache(repo); if (cache.isExcluded(file)) return true; if (file.getName().equals(".gitignore") || file.getName().equals(".gitattributes") || file.getName().equals(".gitmodules")) return false; if (checkSharability && !isSharable(file)) { return true; } return false; }
private void onRefreshButton() { if (context == null || context.getRootFiles().size() == 0) { return; } if (executeStatusSupport != null) { executeStatusSupport.cancel(); executeStatusSupport = null; } LifecycleManager.getDefault().saveAll(); RequestProcessor rp = Git.getInstance().getRequestProcessor(); executeStatusSupport = new GitProgressSupport() { public void perform() { StatusAction.executeStatus(context, this); SwingUtilities.invokeLater( new Runnable() { public void run() { refreshSetups(); } }); } }; String repository = GitUtils.getRootPath(context); executeStatusSupport.start( rp, repository, NbBundle.getMessage(MultiDiffPanel.class, "MSG_Refresh_Progress")); }
public static void resolve(VCSContext ctx) { StatusCache cache = Git.getInstance().getStatusCache(); File[] files = cache.listFiles(ctx, StatusInfo.STATUS_VERSIONED_CONFLICT); resolveConflicts(files); return; }
@Override public void addNotify() { super.addNotify(); if (refreshTask != null) { Git.getInstance().getStatusCache().addPropertyChangeListener(this); } JComponent parent = (JComponent) getParent(); parent.getActionMap().put("jumpNext", nextAction); // NOI18N parent.getActionMap().put("jumpPrev", prevAction); // NOI18N }
@Override public boolean isEnabled() { StatusCache cache = Git.getInstance().getStatusCache(); return cache.containsFileOfStatus(context, StatusInfo.STATUS_VERSIONED_CONFLICT); }
public SetupsComparator() { cache = Git.getInstance().getStatusCache(); }
@Override public void removeNotify() { Git.getInstance().getStatusCache().removePropertyChangeListener(this); super.removeNotify(); }