[PATCH] gitk: Refresh the index

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

 



If one or more tracked files changed non-tracked metadata like mtime,
gitk would report it as "Local uncommitted changes, not checked in to
index" even if no actual changes have been made. (Clicking on the
"Local uncommitted changes.." entry would show the file but without
any diff.)

This refreshes the index in readdiffindex to avoid this and make gitk
behave more like "git status" instead.

Signed-off-by: Christian Jaeger <chrjae@xxxxxxxxx>
---
 gitk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

 * NOTE: I'm not subscribed to the mailing list. *

diff --git a/gitk b/gitk
index a0214b7..bb0e8e1 100755
--- a/gitk
+++ b/gitk
@@ -4898,6 +4898,7 @@ proc readdiffindex {fd serial inst} {
     }
 
     # now see if there are any local changes not checked in to the index
+    exec git update-index -q --refresh
     set cmd "|git diff-files"
     if {$vfilelimit($curview) ne {}} {
 	set cmd [concat $cmd -- $vfilelimit($curview)]
-- 
1.6.4.4

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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]