List of usage examples for org.eclipse.jgit.transport RemoteConfig removePushRefSpec
public boolean removePushRefSpec(RefSpec s)
From source file:org.eclipse.egit.core.internal.gerrit.GerritUtil.java
License:Open Source License
/** * Configure the gerrit push refspec HEAD:refs/for/<gerritBranch> * * @param remoteConfig/*from w w w . ja v a 2s . c o m*/ * the remote configuration to configure this in * @param gerritBranch * the branch to push to review for */ public static void configurePushRefSpec(RemoteConfig remoteConfig, String gerritBranch) { List<RefSpec> pushRefSpecs = new ArrayList<RefSpec>(remoteConfig.getPushRefSpecs()); for (RefSpec refSpec : pushRefSpecs) { remoteConfig.removePushRefSpec(refSpec); } remoteConfig.addPushRefSpec(new RefSpec("HEAD:" + GerritUtil.REFS_FOR + gerritBranch)); //$NON-NLS-1$ }