void verifyDirectories(URIish u) { if (directory == null && gitDir == null) { directory = new File(u.getHumanishName() + (bare ? Constants.DOT_GIT_EXT : "")); //$NON-NLS-1$ } directoryExistsInitially = directory != null && directory.exists(); gitDirExistsInitially = gitDir != null && gitDir.exists(); validateDirs(directory, gitDir, bare); if (isNonEmptyDirectory(directory)) { throw new JGitInternalException(MessageFormat.format( JGitText.get().cloneNonEmptyDirectory, directory.getName())); } if (isNonEmptyDirectory(gitDir)) { throw new JGitInternalException(MessageFormat.format( JGitText.get().cloneNonEmptyDirectory, gitDir.getName())); } }
public String getRemoteName() { return fetchUri.getHumanishName(); }
/** * @param subtreeDirectory * the target directory into which the repository should be * merged, can be <code>"."</code> to not change the directory * layout on merge * @param fetchUri * the URI where the repository is located (a local one is * preferred while experimenting with conversion, so that it does * not have to be fetched multiple times) */ public SubtreeConfig(String subtreeDirectory, URIish fetchUri) { this.subtreeDirectory = subtreeDirectory; this.fetchUri = fetchUri; this.repositoryName = fetchUri.getHumanishName(); if (this.repositoryName.isEmpty()) { throw new IllegalArgumentException( "Could not determine repository name from fetch URI: " + fetchUri); } }
@NonNull @Override public String getSourceName() { // we will never be called here as do not match any navigator return u.getHumanishName(); }
void verifyDirectories(URIish u) { if (directory == null && gitDir == null) { directory = new File(u.getHumanishName() + (bare ? Constants.DOT_GIT_EXT : "")); //$NON-NLS-1$ } directoryExistsInitially = directory != null && directory.exists(); gitDirExistsInitially = gitDir != null && gitDir.exists(); validateDirs(directory, gitDir, bare); if (isNonEmptyDirectory(directory)) { throw new JGitInternalException(MessageFormat.format( JGitText.get().cloneNonEmptyDirectory, directory.getName())); } if (isNonEmptyDirectory(gitDir)) { throw new JGitInternalException(MessageFormat.format( JGitText.get().cloneNonEmptyDirectory, gitDir.getName())); } }
private Repository init(URIish u) throws GitAPIException { InitCommand command = Git.init(); command.setBare(bare); if (directory == null && gitDir == null) directory = new File(u.getHumanishName(), Constants.DOT_GIT); validateDirs(directory, gitDir, bare); if (directory != null && directory.exists() && directory.listFiles().length != 0) throw new JGitInternalException(MessageFormat.format( JGitText.get().cloneNonEmptyDirectory, directory.getName())); if (gitDir != null && gitDir.exists() && gitDir.listFiles().length != 0) throw new JGitInternalException(MessageFormat.format( JGitText.get().cloneNonEmptyDirectory, gitDir.getName())); if (directory != null) command.setDirectory(directory); if (gitDir != null) command.setGitDir(gitDir); return command.call().getRepository(); }
validatedRepoSelection = repoSelection; final String n = validatedRepoSelection.getURI().getHumanishName(); setDescription(NLS.bind(UIText.CloneDestinationPage_description, n)); String defaultRepoDir = UIUtils.getDefaultRepositoryDir();
if (localName == null) { try { localName = uri.getHumanishName(); } catch (IllegalArgumentException e) { throw die(MessageFormat.format(CLIText.get().cannotGuessLocalNameFrom, sourceUri));