/** * Get the names of all known remotes * * @return the names of all known remotes * @since 3.4 */ @NonNull public Set<String> getRemoteNames() { return getConfig() .getSubsections(ConfigConstants.CONFIG_REMOTE_SECTION); }
/** * @param parentShell * @param repository */ public NewRemoteDialog(Shell parentShell, Repository repository) { super(parentShell); existingRemotes = repository.getConfig().getSubsections( ConfigConstants.CONFIG_REMOTE_SECTION); }
public Set<String> getRemotes() { if (mRemotes != null) return mRemotes; try { StoredConfig config = getStoredConfig(); Set<String> remotes = config.getSubsections("remote"); mRemotes = new HashSet<String>(remotes); return mRemotes; } catch (StopTaskException e) { } return new HashSet<String>(); }
public Set<String> getRemotes() { if (mRemotes != null) return mRemotes; try { StoredConfig config = getStoredConfig(); Set<String> remotes = config.getSubsections("remote"); mRemotes = new HashSet<String>(remotes); return mRemotes; } catch (StopTaskException e) { } return new HashSet<String>(); }
/** {@inheritDoc} */ @Deprecated @Override public String getDefaultRemote(String _default_) throws GitException, InterruptedException { Set<String> remotes = getConfig(null).getSubsections("remote"); if (remotes.contains(_default_)) return _default_; else return com.google.common.collect.Iterables.getFirst(remotes, null); }
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) { } }
/** * Does the repository have any submodule configurations? * <p> * This method checks for a '.gitmodules' file at the root of the working * directory or any 'submodule' sections in the repository's config file * * @param repository * @return true if submodules, false otherwise */ private boolean hasConfiguredSubmodules(final Repository repository) { if (new File(repository.getWorkTree(), Constants.DOT_GIT_MODULES) .isFile()) return true; return !repository.getConfig() .getSubsections(ConfigConstants.CONFIG_SUBMODULE_SECTION) .isEmpty(); }
public String getRemoteOriginURL() { try { StoredConfig config = getStoredConfig(); String origin = config.getString("remote", "origin", "url"); if (origin != null && !origin.isEmpty()) return origin; Set<String> remoteNames = config.getSubsections("remote"); if (remoteNames.size() == 0) return ""; String url = config.getString("remote", remoteNames.iterator() .next(), "url"); return url; } catch (StopTaskException e) { } return ""; }
public String getRemoteOriginURL() { try { StoredConfig config = getStoredConfig(); String origin = config.getString("remote", "origin", "url"); if (origin != null && !origin.isEmpty()) return origin; Set<String> remoteNames = config.getSubsections("remote"); if (remoteNames.size() == 0) return ""; String url = config.getString("remote", remoteNames.iterator() .next(), "url"); return url; } catch (StopTaskException e) { } return ""; }
/** * Get the names of all known remotes * * @return the names of all known remotes * @since 3.4 */ @NonNull public Set<String> getRemoteNames() { return getConfig() .getSubsections(ConfigConstants.CONFIG_REMOTE_SECTION); }
/** * @return the names of all known remotes * @since 3.4 */ @NonNull public Set<String> getRemoteNames() { return getConfig() .getSubsections(ConfigConstants.CONFIG_REMOTE_SECTION); } }
public void setRemote(String remote, String url) throws IOException { try { StoredConfig config = getStoredConfig(); Set<String> remoteNames = config.getSubsections("remote"); if (remoteNames.contains(remote)) { throw new IOException(String.format( "Remote %s already exists.", remote)); } config.setString("remote", remote, "url", url); String fetch = String.format("+refs/heads/*:refs/remotes/%s/*", remote); config.setString("remote", remote, "fetch", fetch); config.save(); mRemotes.add(remote); } catch (StopTaskException e) { } }
public void setRemote(String remote, String url) throws IOException { try { StoredConfig config = getStoredConfig(); Set<String> remoteNames = config.getSubsections("remote"); if (remoteNames.contains(remote)) { throw new IOException(String.format( "Remote %s already exists.", remote)); } config.setString("remote", remote, "url", url); String fetch = String.format("+refs/heads/*:refs/remotes/%s/*", remote); config.setString("remote", remote, "fetch", fetch); config.save(); mRemotes.add(remote); } catch (StopTaskException e) { } }
.getSubsections(ConfigConstants.CONFIG_REMOTE_SECTION) .contains(config.getName())) { StringBuilder defaultRefSpec = new StringBuilder();
Repository repository = git.getRepository(); StoredConfig storedConfig = repository.getConfig(); Set<String> remotes = storedConfig.getSubsections("remote"); for (String remoteName : remotes) { try {
if (this.remoteName != null) { Set<String> remoteNames = repository.getConfig().getSubsections("remote"); String remoteName = null; for (String desiredName : this.remoteName.split(",")) {
resultList.add(desc); for (String sub : config.getSubsections(key)) { for (String sectionItem : config.getNames(key, sub)) { String sectionId = key + "." + sub + "." + sectionItem; //$NON-NLS-1$ //$NON-NLS-2$
private void list(StoredConfig config) throws IOException, ConfigInvalidException { config.load(); Set<String> sections = config.getSections(); for (String section : sections) { Set<String> names = config.getNames(section); for (String name : names) { for (String value : config.getStringList(section, null, name)) outw.println(section + "." + name + "=" + value); //$NON-NLS-1$ //$NON-NLS-2$ } if (names.isEmpty()) { for (String subsection : config.getSubsections(section)) { names = config.getNames(section, subsection); for (String name : names) { for (String value : config.getStringList(section, subsection, name)) outw.println(section + "." + subsection + "." //$NON-NLS-1$ //$NON-NLS-2$ + name + "=" + value); //$NON-NLS-1$ } } } } } }
.getSubsections(ConfigConstants.CONFIG_REMOTE_SECTION)) remoteText.add(remote);