List of usage examples for org.eclipse.jgit.api SubmoduleSyncCommand addPath
public SubmoduleSyncCommand addPath(String path)
From source file:org.eclipse.egit.core.op.SubmoduleSyncOperation.java
License:Open Source License
public void execute(final IProgressMonitor monitor) throws CoreException { IWorkspaceRunnable action = new IWorkspaceRunnable() { public void run(IProgressMonitor pm) throws CoreException { pm.beginTask("", 1); //$NON-NLS-1$ Map<String, String> updates = null; try { SubmoduleSyncCommand sync = Git.wrap(repository).submoduleSync(); for (String path : paths) sync.addPath(path); updates = sync.call();//www . ja v a 2 s . com } catch (GitAPIException e) { throw new TeamException(e.getLocalizedMessage(), e.getCause()); } finally { if (updates != null && !updates.isEmpty()) repository.notifyIndexChanged(); pm.done(); } } }; ResourcesPlugin.getWorkspace().run(action, monitor != null ? monitor : new NullProgressMonitor()); }