git-gui: Correct file_states when unstaging partly staged entry
When unstaging a partly staged file or submodule, the file_states list was not updated properly (unless unstaged linewise). Its index_info part did not contain the former head_info as it should have but kept its old value. This seems not to have had any bad effects but diminishes the value of the file_states list for future enhancements. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Jens Lehmann committed
Dec 7, 2009 at 21:35 UTC
7ec2b69f1ad54db0acee165701c769de33f5ba13
1 file changed
+3
git-gui.sh
+3
@@ -1613,6 +1613,9 @@ proc merge_state {path new_state {head_info {}} {index_info {}}} {
1613
} elseif {$s0 ne {_} && [string index $state 0] eq {_}
1614
&& $head_info eq {}} {
1615
set head_info $index_info
1616
+ } elseif {$s0 eq {_} && [string index $state 0] ne {_}} {
1617
+ set index_info $head_info
1618
+ set head_info {}
1619
}
1620
1621
set file_states($path) [list $s0$s1 $icon \