aboutsummaryrefslogtreecommitdiff
path: root/lib/diff.tcl
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2024-12-21 14:05:43 +0100
committerJohannes Sixt <j6t@kdbg.org>2024-12-21 14:06:33 +0100
commit5c95773eacee6eeecc16506fad3ca7fe6bf249be (patch)
treebef63b230f4dde2af5f995f0cab17b1da76071ad /lib/diff.tcl
parent0668f0470d68d297bc463027d66668e34a3b1f80 (diff)
parentf823de75a1f4f061c78aa6fff500f35be8d38e69 (diff)
downloadgit-5c95773eacee6eeecc16506fad3ca7fe6bf249be.tar.xz
Merge branch 'js/no-rescan-on-empty-diff'
* js/no-rescan-on-empty-diff: git-gui: Remove forced rescan of stat-dirty files. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Diffstat (limited to 'lib/diff.tcl')
-rw-r--r--lib/diff.tcl26
1 files changed, 6 insertions, 20 deletions
diff --git a/lib/diff.tcl b/lib/diff.tcl
index 871ad488c2..d657bfec05 100644
--- a/lib/diff.tcl
+++ b/lib/diff.tcl
@@ -63,28 +63,17 @@ proc force_diff_encoding {enc} {
}
proc handle_empty_diff {} {
- global current_diff_path file_states file_lists
- global diff_empty_count
+ global current_diff_path file_states
+ global ui_diff
set path $current_diff_path
set s $file_states($path)
if {[lindex $s 0] ne {_M} || [has_textconv $path]} return
- # Prevent infinite rescan loops
- incr diff_empty_count
- if {$diff_empty_count > 1} return
-
- info_popup [mc "No differences detected.
-
-%s has no changes.
-
-The modification date of this file was updated by another application, but the content within the file was not changed.
-
-A rescan will be automatically started to find other files which may have the same state." [short_path $path]]
-
- clear_diff
- display_file $path __
- rescan ui_ready 0
+ $ui_diff conf -state normal
+ $ui_diff insert end [mc "* No differences detected; stage the file to de-list it from Unstaged Changes.\n"] d_info
+ $ui_diff insert end [mc "* Click to find other files that may have the same state.\n"] d_rescan
+ $ui_diff conf -state disabled
}
proc show_diff {path w {lno {}} {scroll_pos {}} {callback {}}} {
@@ -387,7 +376,6 @@ proc read_diff {fd conflict_size cont_info} {
global ui_diff diff_active is_submodule_diff
global is_3way_diff is_conflict_diff current_diff_header
global current_diff_queue
- global diff_empty_count
$ui_diff conf -state normal
while {[gets $fd line] >= 0} {
@@ -559,8 +547,6 @@ proc read_diff {fd conflict_size cont_info} {
if {[$ui_diff index end] eq {2.0}} {
handle_empty_diff
- } else {
- set diff_empty_count 0
}
set callback [lindex $cont_info 1]