threads / patch / 21075

patchgitk: Refresh the index

Subject: [PATCH] gitk: Refresh the index

## tl;dr

One message between Sep 27, 2009 and Sep 27, 2009. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Christian Jaeger· Sep 27, 2009, 23:43 UTC · lore

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@gmail.com>
---
 gitk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
 * NOTE: I'm not subscribed to the mailing list. *
Show changes to gitk +1 −0
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

← back to recent threads