[PATCH 10/13] gitk: use type "remote" for remote-tracking references

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is clearer, and also lets us avoid calling `remotereftext` a second
time for normal branches.

Signed-off-by: Michael Haggerty <mhagger@xxxxxxxxxxxx>
---
 gitk | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/gitk b/gitk
index d22ce5f..44f4d70 100755
--- a/gitk
+++ b/gitk
@@ -6613,9 +6613,11 @@ proc drawtags {id x xt y1} {
 	    if {$head eq $mainhead} {
 		lappend types mainhead
 		lappend wvals [font measure mainfontbold $head]
+	    } elseif {[remotereftext $head text remoteprefix]} {
+		lappend types remote
+		lappend wvals [font measure mainfont $text]
 	    } else {
 		lappend types head
-		remotereftext $head text remoteprefix
 		lappend wvals [font measure mainfont $text]
 	    }
 	    lappend marks $head
@@ -6666,7 +6668,7 @@ proc drawtags {id x xt y1} {
 	    if {$type eq "mainhead"} {
 		set col $headbgcolor
 		set font mainfontbold
-	    } elseif {$type eq "head"} {
+	    } elseif {$type eq "head" || $type eq "remote"} {
 		set col $headbgcolor
 	    } else {
 		set col "#ddddff"
@@ -6674,7 +6676,8 @@ proc drawtags {id x xt y1} {
 	    set xl [expr {$xl - $delta/2}]
 	    $canv create polygon $x $yt $xr $yt $xr $yb $x $yb \
 		-width 1 -outline black -fill $col -tags tag.$id
-	    if {[remotereftext $tag text remoteprefix]} {
+	    if {$type eq "remote"} {
+		remotereftext $tag text remoteprefix
 	        set rwid [font measure mainfont $remoteprefix]
 		set xi [expr {$x + 1}]
 		set yti [expr {$yt + 1}]
-- 
2.9.3




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]