/** * {@inheritDoc} * <p> * Executes the {@code remote} command with all the options and parameters * collected by the setter methods of this class. */ @Override public RemoteConfig call() throws GitAPIException { checkCallable(); try { StoredConfig config = repo.getConfig(); RemoteConfig remote = new RemoteConfig(config, name); config.unsetSection(ConfigConstants.CONFIG_KEY_REMOTE, name); config.save(); return remote; } catch (IOException | URISyntaxException e) { throw new JGitInternalException(e.getMessage(), e); } }
config.unsetSection( ConfigConstants.CONFIG_SUBMODULE_SECTION, name); results.add(new SubmoduleDeinitResult(path, status));
cfg.unsetSection( ConfigConstants.CONFIG_BRANCH_SECTION, shortenedName);
name, Arrays.asList(values)); repoConfig.unsetSection(ConfigConstants.CONFIG_BRANCH_SECTION, shortOldName); repoConfig.save();
StoredConfig config = git.getRepository().getConfig(); config.unsetSection("remote", "origin"); try { config.save(); } catch (IOException e) { logger.error(e.getMessage()); }
public void removeRemote(String remote) throws IOException { try { StoredConfig config = getStoredConfig(); Set<String> remoteNames = config.getSubsections("remote"); if (!remoteNames.contains(remote)) { throw new IOException(String.format("Remote %s does not exist.", remote)); } config.unsetSection("remote", remote); config.save(); mRemotes.remove(remote); } catch (StopTaskException e) { } }
public void removeRemote(String remote) throws IOException { try { StoredConfig config = getStoredConfig(); Set<String> remoteNames = config.getSubsections("remote"); if (!remoteNames.contains(remote)) { throw new IOException(String.format("Remote %s does not exist.", remote)); } config.unsetSection("remote", remote); config.save(); mRemotes.remove(remote); } catch (StopTaskException e) { } }
public void delete() { getConfig().getConfig().unsetSection(ConfigConstants.CONFIG_REMOTE_SECTION, name); }
/** * {@inheritDoc} * <p> * Executes the {@code remote} command with all the options and parameters * collected by the setter methods of this class. */ @Override public RemoteConfig call() throws GitAPIException { checkCallable(); try { StoredConfig config = repo.getConfig(); RemoteConfig remote = new RemoteConfig(config, name); config.unsetSection(ConfigConstants.CONFIG_KEY_REMOTE, name); config.save(); return remote; } catch (IOException | URISyntaxException e) { throw new JGitInternalException(e.getMessage(), e); } }
/** * Executes the {@code remote} command with all the options and parameters * collected by the setter methods of this class. * * @return the {@link RemoteConfig} object of the removed remote */ @Override public RemoteConfig call() throws GitAPIException { checkCallable(); try { StoredConfig config = repo.getConfig(); RemoteConfig remote = new RemoteConfig(config, name); config.unsetSection(ConfigConstants.CONFIG_KEY_REMOTE, name); config.save(); return remote; } catch (IOException | URISyntaxException e) { throw new JGitInternalException(e.getMessage(), e); } }
UIText.ConfigurationEditorComponent_RemoveSectionMessage, section.name))) { editableConfig.unsetSection(section.name, null); markDirty(); section.parent.name + DOT + section.name))) { editableConfig.unsetSection(section.parent.name, section.name); markDirty();
public Object execute(ExecutionEvent event) throws ExecutionException { final RemoteNode node = getSelectedNodes(event).get(0); final String configName = node.getObject(); boolean ok = MessageDialog.openConfirm(getShell(event), UIText.RepositoriesView_ConfirmDeleteRemoteHeader, NLS.bind( UIText.RepositoriesView_ConfirmDeleteRemoteMessage, configName)); if (ok) { StoredConfig config = node.getRepository().getConfig(); config.unsetSection(RepositoriesView.REMOTE, configName); try { config.save(); } catch (IOException e1) { Activator.handleError(UIText.RepositoriesView_ErrorHeader, e1, true); } } return null; } }
config.unsetSection( ConfigConstants.CONFIG_SUBMODULE_SECTION, name); results.add(new SubmoduleDeinitResult(path, status));
cfg.unsetSection( ConfigConstants.CONFIG_BRANCH_SECTION, shortenedName);
name, Arrays.asList(values)); repoConfig.unsetSection(ConfigConstants.CONFIG_BRANCH_SECTION, shortOldName); repoConfig.save();
cfg.unsetSection( ConfigConstants.CONFIG_BRANCH_SECTION, shortenedName);
name, Arrays.asList(values)); repoConfig.unsetSection(ConfigConstants.CONFIG_BRANCH_SECTION, shortOldName); repoConfig.save();
/** * Set a remote repository path. * * @param repositoryDirectory The directory in which the git repo exists. * @param remoteName The name of the remote (i.e. 'origin') * @param remoteUrl The url of the repository. */ public static void setRemote(Path repositoryDirectory, String remoteName, String remoteUrl) { Git git = null; try { git = Git.open(repositoryDirectory.toFile()); StoredConfig config = git.getRepository().getConfig(); config.unsetSection("remote", remoteName); RemoteConfig remoteConfig = new RemoteConfig(config, remoteName); remoteConfig.addURI(new URIish(remoteUrl)); remoteConfig.addFetchRefSpec(new RefSpec("+refs/heads/*:refs/remotes/" + remoteName + "/*")); remoteConfig.update(config); config.save(); } catch (URISyntaxException | IOException e) { throw new GitException("Unable to set the remote repository", e); } finally { close(git); } }
public void execute() { try { // AF-1715: Cleaning origin to prevent errors while importing the new generated repo. git.getRepository().getConfig().unsetSection("remote", remote); git.getRepository().getConfig().save(); RefUpdate updateRef = git.getRepository().updateRef(ref, false); updateRef.setRefLogMessage(ref + " packed-ref deleted", false); updateRef.setForceUpdate(true); updateRef.delete(); } catch (Exception e) { throw new GitException("Error when trying to remove remote", e); } } }