1 /*******************************************************************************
2 * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
3 * Copyright (C) 2008, 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
;
12 import org
.eclipse
.core
.resources
.IResourceRuleFactory
;
13 import org
.eclipse
.core
.resources
.team
.IMoveDeleteHook
;
14 import org
.eclipse
.core
.resources
.team
.ResourceRuleFactory
;
15 import org
.eclipse
.core
.runtime
.CoreException
;
16 import org
.eclipse
.egit
.core
.internal
.storage
.GitFileHistoryProvider
;
17 import org
.eclipse
.egit
.core
.project
.GitProjectData
;
18 import org
.eclipse
.team
.core
.RepositoryProvider
;
19 import org
.eclipse
.team
.core
.history
.IFileHistoryProvider
;
22 * The Team provider class for a Git repository.
24 public class GitProvider
extends RepositoryProvider
{
25 private GitProjectData data
;
27 private GitMoveDeleteHook hook
;
29 private GitFileHistoryProvider historyProvider
;
31 private final IResourceRuleFactory resourceRuleFactory
= new GitResourceRuleFactory();
33 public String
getID() {
34 return getClass().getName();
37 public void configureProject() throws CoreException
{
38 getData().markTeamPrivateResources();
41 public void deconfigure() throws CoreException
{
42 GitProjectData
.delete(getProject());
45 public boolean canHandleLinkedResources() {
50 public boolean canHandleLinkedResourceURI() {
54 public synchronized IMoveDeleteHook
getMoveDeleteHook() {
56 GitProjectData _data
= getData();
58 hook
= new GitMoveDeleteHook(_data
);
64 * @return information about the mapping of an Eclipse project
65 * to a Git repository.
67 public synchronized GitProjectData
getData() {
69 data
= GitProjectData
.get(getProject());
74 public synchronized IFileHistoryProvider
getFileHistoryProvider() {
75 if (historyProvider
== null) {
76 historyProvider
= new GitFileHistoryProvider();
78 return historyProvider
;
82 public IResourceRuleFactory
getRuleFactory() {
83 return resourceRuleFactory
;
86 private static class GitResourceRuleFactory
extends ResourceRuleFactory
{
87 // Use the default rule factory instead of the
88 // pessimistic one by default.