Skip to content

Commit 2ccdfb1

Browse files
committed
git-gui: return early when patch fails to apply
In the procedure apply_or_revert_range_or_line, if the patch does not apply successfully, a dialog is shown, but execution proceeds after that. Instead, return early on error so the parts that come after this don't work on top of an error state. Signed-off-by: Pratyush Yadav <[email protected]>
1 parent 62bd999 commit 2ccdfb1

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
@@ -848,6 +848,8 @@ proc apply_or_revert_range_or_line {x y revert} {
848848
puts -nonewline $p $wholepatch
849849
close $p} err]} {
850850
error_popup "$failed_msg\n\n$err"
851+
unlock_index
852+
return
851853
}
852854

853855
unlock_index

0 commit comments

Comments
 (0)