Don't propose origin remote name if there is one

This commit is contained in:
Kirill Likhodedov
2016-09-26 19:09:33 +03:00
parent bcfdec5ee5
commit 8c014fdf4e
2 changed files with 3 additions and 2 deletions
@@ -98,7 +98,8 @@ class GitConfigureRemotesDialog(val project: Project, val repositories: Collecti
private fun addRemote() {
val repository = getSelectedRepo()
val dialog = GitDefineRemoteDialog(repository, git)
val proposedName = if (repository.remotes.any { it.name == GitRemote.ORIGIN_NAME }) "" else GitRemote.ORIGIN_NAME
val dialog = GitDefineRemoteDialog(repository, git, proposedName, "")
if (dialog.showAndGet()) {
runInModalTask("Adding Remote...", repository,
"Add Remote", "Couldn't add remote ${dialog.remoteName} '${dialog.remoteUrl}'") {
@@ -94,7 +94,7 @@ public class GitDefineRemoteDialog extends DialogWrapper {
@Nullable
@Override
public JComponent getPreferredFocusedComponent() {
return myRemoteUrl;
return myRemoteName.getText().isEmpty() ? myRemoteName : myRemoteUrl;
}
@Override