]> git.ipfire.org Git - thirdparty/git.git/commitdiff
gitk: filter invisible upstream refs from reference list
authorMichael Rappazzo <michael.rappazzo@infor.com>
Thu, 31 Jul 2025 11:53:21 +0000 (07:53 -0400)
committerMichael Rappazzo <michael.rappazzo@infor.com>
Thu, 31 Jul 2025 12:32:49 +0000 (08:32 -0400)
In refill_reflist, upstream refs are now only included if their
commits are visible in the current view. This prevents display
issues like multiple highlighted branches when clicking entries.

Signed-off-by: Michael Rappazzo <michael.rappazzo@infor.com>
gitk

diff --git a/gitk b/gitk
index b31d0b0a63ed0a2c31e001f75e53c4c0a4717493..080192820e8f3c91491d1af00c73b0ff3b0a412a 100755 (executable)
--- a/gitk
+++ b/gitk
@@ -10332,7 +10332,7 @@ proc refill_reflist {} {
         if {![string match "remotes/*" $n] && [string match $reflistfilter $n]} {
             if {[commitinview $headids($n) $curview]} {
                 lappend localrefs [list $n H]
-                if {[info exists upstreamofref($n)]} {
+                if {[info exists upstreamofref($n)] && [commitinview $headids($upstreamofref($n)) $curview]} {
                     lappend trackedremoterefs [list $upstreamofref($n) R]
                 }
             } else {