Collection<String> (@NotNull GitRepository repository, @NotNull String remoteBranch) { Collection<String> trackingBranches = new ArrayList<>(1); for (GitBranchTrackInfo trackInfo : repository.getBranchTrackInfos()) { if (remoteBranch.equals(trackInfo.getRemoteBranch().getNameForLocalOperations())) { trackingBranches.add(trackInfo.getLocalBranch().getName()); } } return trackingBranches; }