From 95005999e6dd47e232ac11ff80b13e723004f66a Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Thu, 16 Oct 2025 14:42:08 +0200 Subject: [PATCH] Use github icon instead of just coloring the branch icon --- pkg/gui/presentation/branches.go | 2 +- pkg/gui/presentation/icons/git_icons.go | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/gui/presentation/branches.go b/pkg/gui/presentation/branches.go index 6cf78dc7c..3e1e5046b 100644 --- a/pkg/gui/presentation/branches.go +++ b/pkg/gui/presentation/branches.go @@ -126,7 +126,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("⬤")) } diff --git a/pkg/gui/presentation/icons/git_icons.go b/pkg/gui/presentation/icons/git_icons.go index 23b7d8787..af292b380 100644 --- a/pkg/gui/presentation/icons/git_icons.go +++ b/pkg/gui/presentation/icons/git_icons.go @@ -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 }