71
global HEAD PARENT commit_type
72
global ui_index ui_other ui_status_value ui_comm
73
global status_active file_states
74
+ global cfg_trust_mtime
75
76
if {$status_active || ![lock_index read]} return
77
101
$ui_comm edit modified false
102
}
103
103
- set status_active 1
104
- set ui_status_value {Refreshing file status...}
105
- set fd_rf [open "| git update-index -q --unmerged --refresh" r]
106
- fconfigure $fd_rf -blocking 0 -translation binary
107
- fileevent $fd_rf readable [list read_refresh $fd_rf $final]
104
+ if {$cfg_trust_mtime == {true}} {
105
+ update_status_stage2 {} $final
106
+ } else {
107
+ set status_active 1
108
+ set ui_status_value {Refreshing file status...}
109
+ set fd_rf [open "| git update-index -q --unmerged --refresh" r]
110
+ fconfigure $fd_rf -blocking 0 -translation binary
111
+ fileevent $fd_rf readable [list update_status_stage2 $fd_rf $final]
112
+ }
113
}
114
110
-proc read_refresh {fd final} {
115
+proc update_status_stage2 {fd final} {
116
global gitdir PARENT commit_type
117
global ui_index ui_other ui_status_value ui_comm
118
global status_active file_states
119
global buf_rdi buf_rdf buf_rlo
120
116
- read $fd
117
- if {![eof $fd]} return
118
- close $fd
121
+ if {$fd != {}} {
122
+ read $fd
123
+ if {![eof $fd]} return
124
+ close $fd
125
+ }
126
127
set ls_others [list | git ls-files --others -z \
128
--exclude-per-directory=.gitignore]
867
868
proc load_repo_config {} {
869
global repo_config
870
+ global cfg_trust_mtime
871
872
array unset repo_config
873
catch {
879
}
880
close $fd_rc
881
}
882
+
883
+ if {[catch {set cfg_trust_mtime $repo_config(gui.trustmtime)}]} {
884
+ set cfg_trust_mtime false
885
+ }
886
+}
887
+
888
+proc save_my_config {} {
889
+ global repo_config
890
+ global cfg_trust_mtime
891
+
892
+ if {[catch {set rc_trustMTime $repo_config(gui.trustmtime)}]} {
893
+ set rc_trustMTime false
894
+ }
895
+ if {$cfg_trust_mtime != $rc_trustMTime} {
896
+ exec git repo-config gui.trustMTime $cfg_trust_mtime
897
+ }
898
}
899
900
proc load_all_remotes {} {
1323
file delete $save
1324
}
1325
1326
+ save_my_config
1327
destroy .
1328
}
1329
1432
.mbar add cascade -label Fetch -menu .mbar.fetch
1433
.mbar add cascade -label Pull -menu .mbar.pull
1434
.mbar add cascade -label Push -menu .mbar.push
1435
+.mbar add cascade -label Options -menu .mbar.options
1436
. configure -menu .mbar
1437
1438
# -- Project Menu
1487
# -- Push Menu
1488
menu .mbar.push
1489
1490
+# -- Options Menu
1491
+menu .mbar.options
1492
+.mbar.options add checkbutton -label {Trust File Modification Timestamp} \
1493
+ -offvalue false \
1494
+ -onvalue true \
1495
+ -variable cfg_trust_mtime
1496
+
1497
# -- Main Window Layout
1498
panedwindow .vpane -orient vertical
1499
panedwindow .vpane.files -orient horizontal