diff options
author | Phillip Wood <phillip.wood@dunelm.org.uk> | 2022-01-26 16:05:40 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-01-26 23:08:53 +0300 |
commit | 4840002a5f44a4c256c55f70c59d3b0506d14e21 (patch) | |
tree | 4dc007512d0fe02557d1dfccc94bcb0ea63a9163 /reset.c | |
parent | ab2fba0868860e610619f885031217d9cc63097a (diff) |
rebase --apply: don't run post-checkout hook if there is an error
The hook should only be run if the worktree and refs were successfully
updated. This primarily affects "rebase --apply" but also "rebase
--merge" when it fast-forwards.
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reset.c')
-rw-r--r-- | reset.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -126,7 +126,7 @@ reset_head_refs: ret = create_symref("HEAD", switch_to_branch, reflog_head); } - if (run_hook) + if (!ret && run_hook) run_hook_le(NULL, "post-checkout", oid_to_hex(head ? head : null_oid()), oid_to_hex(oid), "1", NULL); |