Avoid refresh on up-to-date pull operation
[egit/eclipse.git] / org.eclipse.egit.core / src / org / eclipse / egit / core / op / DeleteTagOperation.java
blobc4c2c3f73cbc834a676ddaed09f5861eeba41828
1 /******************************************************************************
2 * Copyright (c) 2011 GitHub Inc.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License 2.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-2.0/
8 * SPDX-License-Identifier: EPL-2.0
10 * Contributors:
11 * Kevin Sawicki (GitHub Inc.) - initial API and implementation
12 *****************************************************************************/
13 package org.eclipse.egit.core.op;
15 import org.eclipse.core.runtime.CoreException;
16 import org.eclipse.core.runtime.IProgressMonitor;
17 import org.eclipse.core.runtime.jobs.ISchedulingRule;
18 import org.eclipse.egit.core.Activator;
19 import org.eclipse.egit.core.internal.CoreText;
20 import org.eclipse.jgit.api.Git;
21 import org.eclipse.jgit.api.errors.GitAPIException;
22 import org.eclipse.jgit.lib.Repository;
24 /**
25 * Operation that deletes a tag
27 public class DeleteTagOperation implements IEGitOperation {
29 private final Repository repository;
31 private final String tag;
33 /**
34 * Create operation that deletes a single tag
36 * @param repository
37 * @param tag
39 public DeleteTagOperation(final Repository repository, final String tag) {
40 this.repository = repository;
41 this.tag = tag;
44 @Override
45 public void execute(IProgressMonitor monitor) throws CoreException {
46 try {
47 Git.wrap(repository).tagDelete().setTags(tag).call();
48 } catch (GitAPIException e) {
49 throw new CoreException(Activator.error(
50 CoreText.DeleteTagOperation_exceptionMessage, e));
54 @Override
55 public ISchedulingRule getSchedulingRule() {
56 return null;