protected void AddRepoBreadCrumb(RepoInfo repoInfo) { this.BreadCrumbs.Append("Browse", "ViewRepo", repoInfo.DisplayName, new { repoInfo.Name }); this.BreadCrumbs.Append("Browse", "ViewRepo", repoInfo.Branch, new { repoInfo.Branch }); }
public static string ParseCloneUrl(IPrincipal user, RepoInfo repoInfo) { string cloneUrl = Path.Combine(WebConfigurationManager.AppSettings["GitUriRoot"], repoInfo.DisplayName); if (!string.IsNullOrWhiteSpace(user.Identity.Name)) { var username = user.Identity.Name; username = username.IndexOf('\\') > 0 ? username.Substring(username.IndexOf('\\') + 1) : username; cloneUrl = cloneUrl.Replace("[username]", username); } return cloneUrl; }