]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/am.c
hook.[ch]: move find_hook() from run-command.c to hook.c
[thirdparty/git.git] / builtin / am.c
index 0c2ad96b70eef408492987a8b358887cc56dcb9c..3527945a46726560d21f36e3fff271f85d97420c 100644 (file)
@@ -11,6 +11,7 @@
 #include "parse-options.h"
 #include "dir.h"
 #include "run-command.h"
+#include "hook.h"
 #include "quote.h"
 #include "tempfile.h"
 #include "lockfile.h"
@@ -1820,7 +1821,7 @@ static void am_run(struct am_state *state, int resume)
                        printf_ln(_("Patch failed at %s %.*s"), msgnum(state),
                                linelen(state->msg), state->msg);
 
-                       if (advice_amworkdir)
+                       if (advice_enabled(ADVICE_AM_WORK_DIR))
                                advise(_("Use 'git am --show-current-patch=diff' to see the failed patch"));
 
                        die_user_resolve(state);
@@ -1848,7 +1849,6 @@ next:
         */
        if (!state->rebasing) {
                am_destroy(state);
-               close_object_store(the_repository->objects);
                run_auto_maintenance(state->quiet);
        }
 }
@@ -2106,7 +2106,8 @@ static void am_abort(struct am_state *state)
        if (!has_orig_head)
                oidcpy(&orig_head, the_hash_algo->empty_tree);
 
-       clean_index(&curr_head, &orig_head);
+       if (clean_index(&curr_head, &orig_head))
+               die(_("failed to clean index"));
 
        if (has_orig_head)
                update_ref("am --abort", "HEAD", &orig_head,