git-gui: Force an update-index --refresh on unchanged files.
Its possible for external programs to update file modification dates of many files within a repository. I've seen this on Windows with a popular virus scanner, sadly enough. If the user has Trust File Modification Timestamp enabled and the virus scanner touches a large number of files it can be annoying trying to clear them out of the 'Changed But Not Updated' file list by clicking on them one at a time to load the diff. So now we force a rescan as soon as one such file is found, and for just that rescan we disable the Trust File Modification Timestamp option thereby allowing Git to update the modification dates in the index. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Jan 22, 2007 at 17:10 UTC
46aaf90b4901cbae9da9d59ba8cc914dcfc38aa3
1 file changed
+4
-10
git-gui.sh
+4
-10
@@ -335,7 +335,7 @@ proc PARENT {} {
335
return $empty_tree
336
}
337
338
-proc rescan {after} {
338
+proc rescan {after {honor_trustmtime 1}} {
339
global HEAD PARENT MERGE_HEAD commit_type
340
global ui_index ui_workdir ui_status_value ui_comm
341
global rescan_active file_states
@@ -366,7 +366,7 @@ proc rescan {after} {
366
$ui_comm edit modified false
367
}
368
369
- if {$repo_config(gui.trustmtime) eq {true}} {
369
+ if {$honor_trustmtime && $repo_config(gui.trustmtime) eq {true}} {
370
rescan_stage2 {} $after
371
} else {
372
set rescan_active 1
@@ -586,17 +586,11 @@ by another application and you currently have
586
the Trust File Modification Timestamps option
587
enabled, so Git did not automatically detect
588
that there are no content differences in this
589
-file.
590
-
591
-This file will now be removed from the modified
592
-files list, to prevent possible confusion.
593
-"
594
- if {[catch {exec git update-index -- $path} err]} {
595
- error_popup "Failed to refresh index:\n\n$err"
596
- }
589
+file."
590
591
clear_diff
592
display_file $path __
593
+ rescan {set ui_status_value {Ready.}} 0
594
}
595
596
proc show_diff {path w {lno {}}} {