GitFetchResult (@NotNull VirtualFile root, @NotNull String remoteName, @Nullable String branch) { GitRepository repository = myRepositoryManager.getRepositoryForRoot(root); if (repository == null) { return logError("Repository can't be null for " + root, myRepositoryManager.toString()); } GitRemote remote = GitUtil.findRemoteByName(repository, remoteName); if (remote == null) { return logError("Couldn't find remote with the name " + remoteName, null); } return fetchRemote(repository, remote, branch); }