]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/merge.c
Merge branch 'pw/use-in-process-checkout-in-rebase'
[thirdparty/git.git] / builtin / merge.c
index 74e53cf20a776e23efaa36702dffec408e4d29fa..a94a03384ae6da259a1c6abf5fcd5b4b88b8325a 100644 (file)
@@ -490,7 +490,7 @@ static void finish(struct commit *head_commit,
        }
 
        /* Run a post-merge hook */
-       run_hook_le(NULL, "post-merge", squash ? "1" : "0", NULL);
+       run_hooks_l("post-merge", squash ? "1" : "0", NULL);
 
        apply_autostash(git_path_merge_autostash(the_repository));
        strbuf_release(&reflog_message);
@@ -1273,7 +1273,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
        int best_cnt = -1, merge_was_ok = 0, automerge_was_ok = 0;
        struct commit_list *common = NULL;
        const char *best_strategy = NULL, *wt_strategy = NULL;
-       struct commit_list *remoteheads, *p;
+       struct commit_list *remoteheads = NULL, *p;
        void *branch_to_free;
        int orig_argc = argc;
 
@@ -1568,8 +1568,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 
                if (autostash)
                        create_autostash(the_repository,
-                                        git_path_merge_autostash(the_repository),
-                                        "merge");
+                                        git_path_merge_autostash(the_repository));
                if (checkout_fast_forward(the_repository,
                                          &head_commit->object.oid,
                                          &commit->object.oid,
@@ -1640,8 +1639,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 
        if (autostash)
                create_autostash(the_repository,
-                                git_path_merge_autostash(the_repository),
-                                "merge");
+                                git_path_merge_autostash(the_repository));
 
        /* We are going to make a new commit. */
        git_committer_info(IDENT_STRICT);
@@ -1752,6 +1750,10 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
                ret = suggest_conflicts();
 
 done:
+       if (!automerge_was_ok) {
+               free_commit_list(common);
+               free_commit_list(remoteheads);
+       }
        strbuf_release(&buf);
        free(branch_to_free);
        return ret;