Skip to content

Commit

Permalink
git-gui: Correct file_states when unstaging partly staged entry
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jens Lehmann authored and Shawn O. Pearce committed Jan 23, 2010
1 parent e27d106 commit 7ec2b69
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions git-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,9 @@ proc merge_state {path new_state {head_info {}} {index_info {}}} {
} elseif {$s0 ne {_} && [string index $state 0] eq {_}
&& $head_info eq {}} {
set head_info $index_info
} elseif {$s0 eq {_} && [string index $state 0] ne {_}} {
set index_info $head_info
set head_info {}
}
set file_states($path) [list $s0$s1 $icon \
Expand Down

0 comments on commit 7ec2b69

Please sign in to comment.