1 /*******************************************************************************
2 * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>
3 * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>
5 * All rights reserved. This program and the accompanying materials
6 * are made available under the terms of the Eclipse Public License v1.0
7 * which accompanies this distribution, and is available at
8 * http://www.eclipse.org/legal/epl-v10.html
9 *******************************************************************************/
10 package org
.eclipse
.egit
.core
.op
;
12 import java
.util
.Collection
;
14 import org
.eclipse
.core
.resources
.IResource
;
15 import org
.eclipse
.core
.resources
.IWorkspaceRunnable
;
16 import org
.eclipse
.core
.runtime
.CoreException
;
17 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
18 import org
.eclipse
.egit
.core
.internal
.UpdateJob
;
21 * Updates the Git index for the selected resources. Only tracked resources
24 * Accepts a collection of resources (files and/or directories) whose content
25 * should be updated in the corresponding Git repositories. Resources in the
26 * collection can be associated with multiple repositories.
29 public class UpdateOperation
implements IWorkspaceRunnable
{
30 private final Collection rsrcList
;
33 * Create a new operation to update files/folders.
36 * collection of {@link IResource}s which should be added to the
37 * relevant Git repositories.
39 public UpdateOperation(final Collection rsrcs
) {
43 public void run(IProgressMonitor m
) throws CoreException
{
44 new UpdateJob(rsrcList
).schedule();