diff --git a/plugins/git4idea/src/git4idea/GitUtil.java b/plugins/git4idea/src/git4idea/GitUtil.java index 087bfee76ffa..49ff60c1303d 100644 --- a/plugins/git4idea/src/git4idea/GitUtil.java +++ b/plugins/git4idea/src/git4idea/GitUtil.java @@ -1003,7 +1003,7 @@ public class GitUtil { @Nullable public static GitRemote getDefaultRemote(@NotNull Collection remotes) { for (GitRemote remote : remotes) { - if (remote.getName().equals(GitRemote.ORIGIN_NAME)) { + if (remote.getName().equals(GitRemote.ORIGIN)) { return remote; } } diff --git a/plugins/git4idea/src/git4idea/push/GitPushTargetPanel.java b/plugins/git4idea/src/git4idea/push/GitPushTargetPanel.java index fec6f5890915..222bb525d16a 100644 --- a/plugins/git4idea/src/git4idea/push/GitPushTargetPanel.java +++ b/plugins/git4idea/src/git4idea/push/GitPushTargetPanel.java @@ -342,10 +342,10 @@ public class GitPushTargetPanel extends PushTargetPanel { String remoteName2 = o2.getRemote().getName(); int remoteComparison = remoteName1.compareTo(remoteName2); if (remoteComparison != 0) { - if (remoteName1.equals(GitRemote.ORIGIN_NAME)) { + if (remoteName1.equals(GitRemote.ORIGIN)) { return -1; } - if (remoteName2.equals(GitRemote.ORIGIN_NAME)) { + if (remoteName2.equals(GitRemote.ORIGIN)) { return 1; } return remoteComparison; diff --git a/plugins/git4idea/src/git4idea/remote/GitConfigureRemotesDialog.kt b/plugins/git4idea/src/git4idea/remote/GitConfigureRemotesDialog.kt index 6becd559359d..420792746fb7 100644 --- a/plugins/git4idea/src/git4idea/remote/GitConfigureRemotesDialog.kt +++ b/plugins/git4idea/src/git4idea/remote/GitConfigureRemotesDialog.kt @@ -53,7 +53,7 @@ import com.intellij.util.ui.UIUtil import git4idea.commands.Git import git4idea.commands.GitCommandResult import git4idea.repo.GitRemote -import git4idea.repo.GitRemote.ORIGIN_NAME +import git4idea.repo.GitRemote.ORIGIN import git4idea.repo.GitRepository import java.util.* import javax.swing.* @@ -98,7 +98,7 @@ class GitConfigureRemotesDialog(val project: Project, val repositories: Collecti private fun addRemote() { val repository = getSelectedRepo() - val proposedName = if (repository.remotes.any { it.name == GitRemote.ORIGIN_NAME }) "" else GitRemote.ORIGIN_NAME + val proposedName = if (repository.remotes.any { it.name == ORIGIN }) "" else ORIGIN val dialog = GitDefineRemoteDialog(repository, git, proposedName, "") if (dialog.showAndGet()) { runInModalTask("Adding Remote...", repository, @@ -176,10 +176,10 @@ class GitConfigureRemotesDialog(val project: Project, val repositories: Collecti private fun sortedRemotes(repository: GitRepository): List { return repository.remotes.sortedWith(Comparator { r1, r2 -> - if (r1.name == ORIGIN_NAME) { - if (r2.name == ORIGIN_NAME) 0 else -1 + if (r1.name == ORIGIN) { + if (r2.name == ORIGIN) 0 else -1 } - else if (r2.name == ORIGIN_NAME) 1 else r1.name.compareTo(r2.name) + else if (r2.name == ORIGIN) 1 else r1.name.compareTo(r2.name) }) } diff --git a/plugins/git4idea/src/git4idea/remote/GitDefineRemoteDialog.java b/plugins/git4idea/src/git4idea/remote/GitDefineRemoteDialog.java index bb9110e6361d..191cba2f7b10 100644 --- a/plugins/git4idea/src/git4idea/remote/GitDefineRemoteDialog.java +++ b/plugins/git4idea/src/git4idea/remote/GitDefineRemoteDialog.java @@ -52,7 +52,7 @@ public class GitDefineRemoteDialog extends DialogWrapper { @NotNull private final JTextField myRemoteUrl; public GitDefineRemoteDialog(@NotNull GitRepository repository, @NotNull Git git) { - this(repository, git, GitRemote.ORIGIN_NAME, ""); + this(repository, git, GitRemote.ORIGIN, ""); } public GitDefineRemoteDialog(@NotNull GitRepository repository, diff --git a/plugins/git4idea/src/git4idea/repo/GitRemote.java b/plugins/git4idea/src/git4idea/repo/GitRemote.java index 51e0962ee6c9..81d0bda88a79 100644 --- a/plugins/git4idea/src/git4idea/repo/GitRemote.java +++ b/plugins/git4idea/src/git4idea/repo/GitRemote.java @@ -69,7 +69,7 @@ public final class GitRemote implements Comparable { * Default remote name in Git is "origin". * Usually all Git repositories have an "origin" remote, so it can be used as a default value in some cases. */ - public static final String ORIGIN_NAME = "origin"; + public static final String ORIGIN = "origin"; @NotNull private final String myName; @NotNull private final List myUrls;