Example usage for org.eclipse.jgit.api SubmoduleSyncCommand addPath

List of usage examples for org.eclipse.jgit.api SubmoduleSyncCommand addPath

Introduction

In this page you can find the example usage for org.eclipse.jgit.api SubmoduleSyncCommand addPath.

Prototype

public SubmoduleSyncCommand addPath(String path) 

Source Link

Document

Add repository-relative submodule path to synchronize

Usage

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());
}