use of org.eclipse.egit.core.synchronize.dto.GitSynchronizeData in project egit by eclipse.
the class GitSyncCache method mergeAllDataIntoCache.
public static void mergeAllDataIntoCache(Map<GitSynchronizeData, Collection<String>> updateRequests, IProgressMonitor monitor, GitSyncCache cache) {
SubMonitor m = SubMonitor.convert(monitor, updateRequests.size());
for (Entry<GitSynchronizeData, Collection<String>> entry : updateRequests.entrySet()) {
Collection<String> paths = entry.getValue();
GitSyncCache partialCache = getAllData(entry.getKey(), paths);
cache.merge(partialCache, new HashSet<String>(paths));
m.worked(1);
}
m.done();
}
use of org.eclipse.egit.core.synchronize.dto.GitSynchronizeData in project egit by eclipse.
the class SynchronizeWorkspaceActionHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IResource[] resources = getSelectedResources(event);
Map<Repository, Set<IResource>> containerMap = mapContainerResources(resources);
if (containerMap.isEmpty())
return null;
boolean launchFetch = Activator.getDefault().getPreferenceStore().getBoolean(UIPreferences.SYNC_VIEW_FETCH_BEFORE_LAUNCH);
GitSynchronizeDataSet gsdSet = new GitSynchronizeDataSet();
for (Entry<Repository, Set<IResource>> entry : containerMap.entrySet()) try {
Repository repo = entry.getKey();
String dstRef = getDstRef(repo, launchFetch);
GitSynchronizeData data = new GitSynchronizeData(repo, HEAD, dstRef, true);
Set<IResource> containers = entry.getValue();
if (!containers.isEmpty())
data.setIncludedResources(containers);
gsdSet.add(data);
} catch (IOException e) {
Activator.handleError(e.getMessage(), e, true);
}
GitModelSynchronize.launch(gsdSet, getSelectedResources(event));
return null;
}
Aggregations