private static string GuessDisplayName(string fullBranchName) { if (fullBranchName.StartsWith(GitRefHeadPrefix)) { return(fullBranchName.Substring(GitRefHeadPrefix.Length)); } var match = PullRequestPattern.Match(fullBranchName); if (match.Success) { return($"PR {match.Groups[1].Value}"); } return(fullBranchName); }
public string ExtractDisplayName(string fullBranchName) { if (fullBranchName.StartsWith(GitRefHeadPrefix, StringComparison.InvariantCulture)) { return(fullBranchName.Substring(GitRefHeadPrefix.Length)); } var match = PullRequestPattern.Match(fullBranchName); if (match.Success) { return($"PR {match.Groups[1].Value}"); } return(fullBranchName); }