Skip to content

Commit a41e45e

Browse files
committed
git-gui: Refresh file status description after hunk application
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 <[email protected]>
1 parent d36a8f7 commit a41e45e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/diff.tcl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,5 +358,7 @@ proc apply_hunk {x y} {
358358
display_file $current_diff_path $mi
359359
if {$o eq {_}} {
360360
clear_diff
361+
} else {
362+
set current_diff_path $current_diff_path
361363
}
362364
}

0 commit comments

Comments
 (0)