Example usage for org.eclipse.jgit.transport RefSpec WILDCARD_SUFFIX

List of usage examples for org.eclipse.jgit.transport RefSpec WILDCARD_SUFFIX

Introduction

In this page you can find the example usage for org.eclipse.jgit.transport RefSpec WILDCARD_SUFFIX.

Prototype

String WILDCARD_SUFFIX

To view the source code for org.eclipse.jgit.transport RefSpec WILDCARD_SUFFIX.

Click Source Link

Document

Suffix for wildcard ref spec component, that indicate matching all refs with specified prefix.

Usage

From source file:org.eclipse.egit.ui.internal.fetch.SimpleConfigureFetchDialog.java

License:Open Source License

/**
 * @param shell/*from   w  w  w .  jav a2  s .  co m*/
 * @param repository
 * @param config
 * @param showBranchInfo
 *            should be true if this is used for upstream configuration; if
 *            false, branch information will be hidden in the dialog
 */
private SimpleConfigureFetchDialog(Shell shell, Repository repository, RemoteConfig config,
        boolean showBranchInfo) {
    super(shell);
    setHelpAvailable(false);
    setShellStyle(getShellStyle() | SWT.SHELL_TRIM);
    this.repository = repository;
    this.config = config;
    this.showBranchInfo = showBranchInfo;

    // Add default fetch ref spec if this is a new remote config
    if (config.getFetchRefSpecs().isEmpty() && !repository.getConfig()
            .getSubsections(ConfigConstants.CONFIG_REMOTE_SECTION).contains(config.getName())) {
        StringBuilder defaultRefSpec = new StringBuilder();
        defaultRefSpec.append('+');
        defaultRefSpec.append(Constants.R_HEADS);
        defaultRefSpec.append('*').append(':');
        defaultRefSpec.append(Constants.R_REMOTES);
        defaultRefSpec.append(config.getName());
        defaultRefSpec.append(RefSpec.WILDCARD_SUFFIX);
        config.addFetchRefSpec(new RefSpec(defaultRefSpec.toString()));
    }
}