gitk: Teach "Reread references" to reload tags
authorDavid Aguilar <davvid@gmail.com>
Sat, 8 Sep 2012 19:03:13 +0000 (12:03 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 9 Sep 2012 03:25:09 +0000 (20:25 -0700)
Tag contents, once read, are forever cached in memory.
This makes gitk unable to notice when tag contents change.

Allow users to cause a reload of the tag contents by using
the "File->Reread references" action.

Reported-by: Tim McCormack <cortex@brainonfire.net>
Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gitk
diff --git a/gitk b/gitk
index 9bba9aa8d1128c4e2b52b26060e727511ebbb221..a124822626fa3c80231985552564675ff5e2ea81 100755 (executable)
--- a/gitk
+++ b/gitk
@@ -10599,7 +10599,7 @@ proc movedhead {hid head} {
 }
 
 proc changedrefs {} {
 }
 
 proc changedrefs {} {
-    global cached_dheads cached_dtags cached_atags
+    global cached_dheads cached_dtags cached_atags tagcontents
     global arctags archeads arcnos arcout idheads idtags
 
     foreach id [concat [array names idheads] [array names idtags]] {
     global arctags archeads arcnos arcout idheads idtags
 
     foreach id [concat [array names idheads] [array names idtags]] {
@@ -10611,6 +10611,7 @@ proc changedrefs {} {
            }
        }
     }
            }
        }
     }
+    catch {unset tagcontents}
     catch {unset cached_dtags}
     catch {unset cached_atags}
     catch {unset cached_dheads}
     catch {unset cached_dtags}
     catch {unset cached_atags}
     catch {unset cached_dheads}