@NotNull private String getRemoteBranchToMerge() { GitBranchPair gitBranchPair = myTrackedBranches.get(myRoot); GitBranch dest = gitBranchPair.getDest(); LOG.assertTrue( dest != null, String.format( "Destination branch is null for source branch %s in %s", gitBranchPair.getBranch().getName(), myRoot)); return dest.getName(); }
/** * Checks if update is needed, i.e. if there are remote changes that weren't merged into the * current branch. * * @return true if update is needed, false otherwise. */ public boolean isUpdateNeeded() throws VcsException { GitBranchPair gitBranchPair = myTrackedBranches.get(myRoot); String currentBranch = gitBranchPair.getBranch().getName(); GitBranch dest = gitBranchPair.getDest(); assert dest != null; String remoteBranch = dest.getName(); if (!hasRemoteChanges(currentBranch, remoteBranch)) { LOG.info("isSaveNeeded No remote changes, save is not needed"); return false; } return true; }