Skip to content

Commit

Permalink
git-gui: Refresh file status description after hunk application
Browse files Browse the repository at this point in the history
If we apply a hunk in either direction this may change the file's
status.  For example if a file is completely unstaged, and has at
least two hunks in it and the user stages one hunk the file will
change from "Modified, not staged" to "Portions staged for commit".

Resetting the file path causes our trace on this variable to fire;
that trace is used to update the file header in the diff viewer to
the file's current status.

Noticed by Johannes Sixt.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
  • Loading branch information
Shawn O. Pearce committed Jan 16, 2008
1 parent d36a8f7 commit a41e45e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/diff.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -358,5 +358,7 @@ proc apply_hunk {x y} {
display_file $current_diff_path $mi
if {$o eq {_}} {
clear_diff
} else {
set current_diff_path $current_diff_path
}
}

0 comments on commit a41e45e

Please sign in to comment.