private void setSubsection(String subsection, String value) { if (value == null || value.equals("")) { mConfig.unset(USER_SECTION, null, subsection); } else { mConfig.setString(USER_SECTION, null, subsection, value); } try { mConfig.save(); } catch (IOException e) { Timber.e(e); } }
@Override public void onClick(DialogInterface dialogInterface, int i) { try { StoredConfig config = ((Repo)getArguments().getSerializable(REPO_ARG_KEY)).getGit().getRepository().getConfig(); String email = mGitEmail.getText().toString(); String name = mGitName.getText().toString(); if (email == null || email.equals("")) { config.unset("user", null, "email"); } else { config.setString("user", null, "email", email); } if (name == null || name.equals("")) { config.unset("user", null, "name"); } else { config.setString("user", null, "name", name); } config.save(); } catch (StopTaskException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }
public Object execute(ExecutionEvent event) throws ExecutionException { PushNode node = getSelectedNodes(event).get(0); RemoteNode remote = (RemoteNode) node.getParent(); StoredConfig config = node.getRepository().getConfig(); config.unset("remote", remote.getObject(), "pushurl"); //$NON-NLS-1$ //$NON-NLS-2$ config.unset("remote", remote.getObject(), "push"); //$NON-NLS-1$ //$NON-NLS-2$ try { config.save(); } catch (IOException e1) { Activator.handleError(e1.getMessage(), e1, true); } return null; } }
merge); else myConfig.unset(ConfigConstants.CONFIG_BRANCH_SECTION, myBranchName, ConfigConstants.CONFIG_KEY_MERGE); remote); else myConfig.unset(ConfigConstants.CONFIG_BRANCH_SECTION, myBranchName, ConfigConstants.CONFIG_KEY_REMOTE); true); else myConfig.unset(ConfigConstants.CONFIG_BRANCH_SECTION, myBranchName, ConfigConstants.CONFIG_KEY_REBASE); try {