aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diff.tcl
diff options
context:
space:
mode:
authorPratyush Yadav <me@yadavpratyush.com>2019-08-26 04:23:13 +0530
committerPratyush Yadav <me@yadavpratyush.com>2019-08-26 04:23:13 +0530
commit2ccdfb1c78e1695c4df714887b73ab417ca60f22 (patch)
tree01785d258c4efcb92b2e25a6570dc1dd32000a10 /lib/diff.tcl
parentgit-gui: allow reverting selected hunk (diff)
downloadgit-2ccdfb1c78e1695c4df714887b73ab417ca60f22.tar.gz
git-2ccdfb1c78e1695c4df714887b73ab417ca60f22.zip
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 <me@yadavpratyush.com>
Diffstat (limited to 'lib/diff.tcl')
-rw-r--r--lib/diff.tcl2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/diff.tcl b/lib/diff.tcl
index ffca7880e1..0659029632 100644
--- a/lib/diff.tcl
+++ b/lib/diff.tcl
@@ -848,6 +848,8 @@ proc apply_or_revert_range_or_line {x y revert} {
puts -nonewline $p $wholepatch
close $p} err]} {
error_popup "$failed_msg\n\n$err"
+ unlock_index
+ return
}
unlock_index