Skip to content

Commit 7ec2b69

Browse files
jlehmannspearce
authored andcommitted
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 <[email protected]> Signed-off-by: Shawn O. Pearce <[email protected]>
1 parent e27d106 commit 7ec2b69

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

git-gui.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,6 +1613,9 @@ proc merge_state {path new_state {head_info {}} {index_info {}}} {
16131613
} elseif {$s0 ne {_} && [string index $state 0] eq {_}
16141614
&& $head_info eq {}} {
16151615
set head_info $index_info
1616+
} elseif {$s0 eq {_} && [string index $state 0] ne {_}} {
1617+
set index_info $head_info
1618+
set head_info {}
16161619
}
16171620
16181621
set file_states($path) [list $s0$s1 $icon \

0 commit comments

Comments
 (0)