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 * See LICENSE for the full license text, also available.
8 *******************************************************************************/
9 package org
.spearce
.egit
.core
.op
;
11 import java
.util
.Collection
;
13 import org
.eclipse
.core
.resources
.IResource
;
14 import org
.eclipse
.core
.resources
.IWorkspaceRunnable
;
15 import org
.eclipse
.core
.runtime
.CoreException
;
16 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
17 import org
.spearce
.egit
.core
.internal
.UpdateJob
;
20 * Updates the Git index for the selected resources. Only tracked resources
23 * Accepts a collection of resources (files and/or directories) whose content
24 * should be updated in the corresponding Git repositories. Resources in the
25 * collection can be associated with multiple repositories.
28 public class UpdateOperation
implements IWorkspaceRunnable
{
29 private final Collection rsrcList
;
32 * Create a new operation to update files/folders.
35 * collection of {@link IResource}s which should be added to the
36 * relevant Git repositories.
38 public UpdateOperation(final Collection rsrcs
) {
42 public void run(IProgressMonitor m
) throws CoreException
{
43 new UpdateJob(rsrcList
).schedule();