diff --git a/plugins/git4idea/src/git4idea/GitVcs.java b/plugins/git4idea/src/git4idea/GitVcs.java
index 12ab13e48880..e63cf01cfdba 100644
--- a/plugins/git4idea/src/git4idea/GitVcs.java
+++ b/plugins/git4idea/src/git4idea/GitVcs.java
@@ -363,11 +363,8 @@ public class GitVcs extends AbstractVcs {
private void checkExecutableAndVersion() {
boolean executableIsAlreadyCheckedAndFine = false;
- String pathToGit = myAppSettings.getPathToGitAtStartup();
- if (pathToGit == null) {
- myAppSettings.setPathToGit(new GitExecutableDetector().detect());
- }
- else if (!pathToGit.contains(File.separator)) { // no path, just sole executable, with a hope that it is in path
+ String pathToGit = myAppSettings.getPathToGit();
+ if (!pathToGit.contains(File.separator)) { // no path, just sole executable, with a hope that it is in path
// subject to redetect the path if executable validator fails
if (!myExecutableValidator.isExecutableValid()) {
myAppSettings.setPathToGit(new GitExecutableDetector().detect());
diff --git a/plugins/git4idea/src/git4idea/config/GitVcsApplicationSettings.java b/plugins/git4idea/src/git4idea/config/GitVcsApplicationSettings.java
index fa3ef96986bf..88dbb0a05917 100644
--- a/plugins/git4idea/src/git4idea/config/GitVcsApplicationSettings.java
+++ b/plugins/git4idea/src/git4idea/config/GitVcsApplicationSettings.java
@@ -59,25 +59,12 @@ public class GitVcsApplicationSettings implements PersistentStateComponentThis method differs from {@link #getPathToGit()} only in the @Nullable annotation: initially the path can be null,
- * but after VCS is initialized for the first time, correct path is set in {@link git4idea.GitVcs} and is never null,
- * so we want the @NotNull annotation there.
- * This method should be called only from {@link git4idea.GitVcs#activate()}.
- *
- * @return Path to Git or null if the path was not written to the config yet.
- */
- @Nullable
- public String getPathToGitAtStartup() {
- return myState.myPathToGit;
- }
-
public void setPathToGit(String pathToGit) {
myState.myPathToGit = pathToGit;
}