if (branch != null) {
string.append(' ');
string.append('[', StyledString.DECORATIONS_STYLER);
string.append(branch, StyledString.DECORATIONS_STYLER);
BranchTrackingStatus trackingStatus = BranchTrackingStatus.of(
repository, branch);
if (trackingStatus != null
&& (trackingStatus.getAheadCount() != 0 || trackingStatus
.getBehindCount() != 0)) {
String formattedTrackingStatus = GitLabels
.formatBranchTrackingStatus(trackingStatus);
string.append(' ');
string.append(formattedTrackingStatus,