]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'pw/rebase-autostash-fix'
authorJunio C Hamano <gitster@pobox.com>
Fri, 20 Sep 2024 18:16:29 +0000 (11:16 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 20 Sep 2024 18:16:30 +0000 (11:16 -0700)
"git rebase --autostash" failed to resurrect the autostashed
changes when the command gets aborted after giving back control
asking for hlep in conflict resolution.

* pw/rebase-autostash-fix:
  rebase: apply and cleanup autostash when rebase fails to start

1  2 
builtin/rebase.c
t/t3400-rebase.sh

index a2c96c080e1526f6fb279bd8eb76c2f277073e3d,ac23c4ddbb00bc17975aa68941f7c6866c9fbf2f..c8361ed9292d913e854028c0f172e5eabde9f996
@@@ -1775,9 -1791,11 +1792,11 @@@ int cmd_rebase(int argc, const char **a
  
        /* If a hook exists, give it a chance to interrupt*/
        if (!ok_to_skip_pre_rebase &&
 -          run_hooks_l("pre-rebase", options.upstream_arg,
 +          run_hooks_l(the_repository, "pre-rebase", options.upstream_arg,
-                       argc ? argv[0] : NULL, NULL))
-               die(_("The pre-rebase hook refused to rebase."));
+                       argc ? argv[0] : NULL, NULL)) {
+               ret = error(_("The pre-rebase hook refused to rebase."));
+               goto cleanup_autostash;
+       }
  
        if (options.flags & REBASE_DIFFSTAT) {
                struct diff_options opts;
Simple merge