diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2009-02-07 19:24:01 +0300 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2009-02-08 11:50:11 -0800 |
commit | 584fa9ccf4b467e7633c100333cadf92e0c07894 (patch) | |
tree | c5e62d87d95dd8c4e04026895bb88d049ab7cdda /lib/merge.tcl | |
parent | 06569cd5bef7c8e3925bd36870abc083ae7b93f8 (diff) | |
download | git-584fa9ccf4b467e7633c100333cadf92e0c07894.tar.gz git-584fa9ccf4b467e7633c100333cadf92e0c07894.tar.xz |
git-gui: Avoid an infinite rescan loop in handle_empty_diff.
If the index update machinery and git diff happen to disagree
on whether a particular file is modified, it may cause git-gui
to enter an infinite index rescan loop, where an empty diff
starts a rescan, which finds the same set of files modified,
and tries to display the diff for the first one, which happens
to be the empty one. A current example of a possible disagreement
point is the autocrlf filter.
This patch breaks the loop by using a global counter to track
the auto-rescans. The variable is reset whenever a non-empty
diff is displayed.
Another suggested approach, which is based on giving the
--exit-code argument to git diff, cannot be used, because
diff-files seems to trust the timestamps in the index, and
returns a non-zero code even if the file is actually
unchanged, which essentially defeats the purpose of the
auto-rescan logic.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib/merge.tcl')
0 files changed, 0 insertions, 0 deletions