commit 6ba2bea2c0ffc926c79ca53e0a920f8f219e020c from: Stefan Sperling date: Sat Jul 27 20:01:57 2019 UTC abort histedit operation if we don't manage to install the script commit - a9fa2909b9b3f681373c249f42a233d89335fc4c commit + 6ba2bea2c0ffc926c79ca53e0a920f8f219e020c blob - 1f7e06bc83f1f310376caf2d3e19376e7db9949f blob + c926775b2c575890e95f39a41cea7ab7ccd65b74 --- got/got.c +++ got/got.c @@ -4785,7 +4785,7 @@ cmd_histedit(int argc, char *argv[]) struct got_object_id *base_commit_id = NULL; struct got_object_id *head_commit_id = NULL; struct got_commit_object *commit = NULL; - int ch, rebase_in_progress = 0; + int ch, rebase_in_progress = 0, did_something; int edit_in_progress = 0, abort_edit = 0, continue_edit = 0; const char *edit_script_path = NULL; unsigned char rebase_status = GOT_STATUS_NO_CHANGE; @@ -4865,7 +4865,6 @@ cmd_histedit(int argc, char *argv[]) goto done; if (edit_in_progress && abort_edit) { - int did_something; error = got_worktree_histedit_continue(&resume_commit_id, &tmp_branch, &branch, &base_commit_id, &fileindex, worktree, repo); @@ -4973,20 +4972,32 @@ cmd_histedit(int argc, char *argv[]) if (edit_script_path) { error = histedit_load_list(&histedit_cmds, edit_script_path, repo); - if (error) + if (error) { + got_worktree_histedit_abort(worktree, fileindex, + repo, branch, base_commit_id, + update_progress, &did_something); goto done; + } } else { error = histedit_edit_script(&histedit_cmds, &commits, repo); - if (error) + if (error) { + got_worktree_histedit_abort(worktree, fileindex, + repo, branch, base_commit_id, + update_progress, &did_something); goto done; + } } error = histedit_save_list(&histedit_cmds, worktree, repo); - if (error) + if (error) { + got_worktree_histedit_abort(worktree, fileindex, + repo, branch, base_commit_id, + update_progress, &did_something); goto done; + } }