1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-10-30 23:57:43 +02:00

Use github icon instead of just coloring the branch icon

This commit is contained in:
Stefan Haller
2025-10-16 14:42:08 +02:00
parent 8c9a076179
commit ebc97cf2b7
2 changed files with 10 additions and 1 deletions

View File

@@ -127,7 +127,7 @@ func getBranchDisplayStrings(
pr, hasPr := prs[b.Name]
if hasPr {
if icons.IsIconEnabled() {
res = append(res, prColor(pr.State).Sprint(icons.IconForBranch(b)))
res = append(res, prColor(pr.State).Sprint(icons.IconForRemoteUrl(pr.Url)))
} else {
res = append(res, prColor(pr.State).Sprint("⬤"))
}

View File

@@ -79,6 +79,15 @@ func IconForRemote(remote *models.Remote) string {
return DEFAULT_REMOTE_ICON
}
func IconForRemoteUrl(url string) string {
for domain, icon := range remoteIcons {
if strings.Contains(url, domain) {
return icon
}
}
return DEFAULT_REMOTE_ICON
}
func IconForStash(stash *models.StashEntry) string {
return STASH_ICON
}