Commit 7cf4566
git-gui: Fix the after callback execution in rescan.
The rescan function receives a callback command
as its parameter, which is supposed to be executed
after the scan finishes. It is generally used to
update status. However, rescan may initiate a
loading of a diff, which always calls ui_ready after
completion. If the after handler is called before
that, ui_ready will override the new status.
This commit ensures that the after callback is
properly threaded through the diff machinery.
Since it uncovered the fact that force_first_diff
actually didn't work due to an undeclared global
variable, and the desired effects appeared only
because of the race condition between the diff
system and the rescan callback, I also reimplement
this function to make it behave as originally
intended.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>1 parent 153ad78 commit 7cf4566
2 files changed
Lines changed: 31 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1491 | 1491 | | |
1492 | 1492 | | |
1493 | 1493 | | |
1494 | | - | |
1495 | | - | |
1496 | | - | |
1497 | | - | |
| 1494 | + | |
| 1495 | + | |
1498 | 1496 | | |
1499 | 1497 | | |
1500 | 1498 | | |
| |||
2006 | 2004 | | |
2007 | 2005 | | |
2008 | 2006 | | |
2009 | | - | |
| 2007 | + | |
2010 | 2008 | | |
2011 | 2009 | | |
2012 | 2010 | | |
2013 | 2011 | | |
2014 | 2012 | | |
2015 | 2013 | | |
2016 | | - | |
| 2014 | + | |
2017 | 2015 | | |
2018 | | - | |
| 2016 | + | |
2019 | 2017 | | |
2020 | 2018 | | |
2021 | 2019 | | |
| |||
2100 | 2098 | | |
2101 | 2099 | | |
2102 | 2100 | | |
2103 | | - | |
| 2101 | + | |
2104 | 2102 | | |
2105 | 2103 | | |
2106 | 2104 | | |
2107 | 2105 | | |
2108 | | - | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
2109 | 2109 | | |
2110 | 2110 | | |
2111 | 2111 | | |
2112 | | - | |
2113 | | - | |
| 2112 | + | |
| 2113 | + | |
2114 | 2114 | | |
2115 | 2115 | | |
2116 | 2116 | | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
2117 | 2120 | | |
2118 | | - | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
2119 | 2130 | | |
2120 | 2131 | | |
2121 | | - | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
2122 | 2137 | | |
2123 | 2138 | | |
2124 | 2139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
0 commit comments