summaryrefslogtreecommitdiff
path: root/git-gui.sh
diff options
context:
space:
mode:
authorLibravatar Shawn O. Pearce <spearce@spearce.org>2007-01-22 22:41:13 -0500
committerLibravatar Shawn O. Pearce <spearce@spearce.org>2007-01-23 01:48:50 -0500
commit124355d32c0612192e729e12f1d3d68849754f29 (patch)
tree67cacd99d5bd6af80c2e91d24b522269cdb76138 /git-gui.sh
parentgit-gui: Ignore 'No newline at end of file' marker line. (diff)
downloadtgif-124355d32c0612192e729e12f1d3d68849754f29.tar.xz
git-gui: Always start a rescan on an empty diff.
If we got an empty diff its probably because the modification time of the file was changed but the file content hasn't been changed. Typically this happens because an outside program modified the file and git-gui was told to not run 'update-index --refresh', as the user generally trusts file modification timestamps. But we can also get an empty diff when a program undos a file change and still updates the modification timestamp upon saving, but has undone the file back to the same as what is in the index or in PARENT. So even if gui.trustmtime is false we should still run a rescan on an empty diff. This change also lets us cleanup the dialog message that we show when this case occurs, as its no longer got anything to do with Trust File Modification Timestamps. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-gui.sh')
-rwxr-xr-xgit-gui.sh14
1 files changed, 6 insertions, 8 deletions
diff --git a/git-gui.sh b/git-gui.sh
index 54204aee78..6ccd4113d8 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -582,11 +582,11 @@ proc handle_empty_diff {} {
[short_path $path] has no changes.
The modification date of this file was updated
-by another application and you currently have
-the Trust File Modification Timestamps option
-enabled, so Git did not automatically detect
-that there are no content differences in this
-file."
+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."
clear_diff
display_file $path __
@@ -683,7 +683,6 @@ proc show_diff {path w {lno {}}} {
proc read_diff {fd} {
global ui_diff ui_status_value is_3way_diff diff_active
- global repo_config
$ui_diff conf -state normal
while {[gets $fd line] >= 0} {
@@ -763,8 +762,7 @@ proc read_diff {fd} {
unlock_index
set ui_status_value {Ready.}
- if {$repo_config(gui.trustmtime) eq {true}
- && [$ui_diff index end] eq {2.0}} {
+ if {[$ui_diff index end] eq {2.0}} {
handle_empty_diff
}
}