]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/am.c
Merge branch 'tt/bisect-in-c'
[thirdparty/git.git] / builtin / am.c
index 310eefe9e8e74a529e578d842b8d376a0afc0d8e..0cc399729205a3adfc8afe0d211bdba13e1a3977 100644 (file)
@@ -1954,7 +1954,7 @@ static int clean_index(const struct object_id *head, const struct object_id *rem
        if (merge_tree(remote_tree))
                return -1;
 
-       remove_branch_state();
+       remove_branch_state(the_repository);
 
        return 0;
 }
@@ -1965,7 +1965,7 @@ static int clean_index(const struct object_id *head, const struct object_id *rem
 static void am_rerere_clear(void)
 {
        struct string_list merge_rr = STRING_LIST_INIT_DUP;
-       rerere_clear(&merge_rr);
+       rerere_clear(the_repository, &merge_rr);
        string_list_clear(&merge_rr, 1);
 }
 
@@ -1984,6 +1984,15 @@ static void am_skip(struct am_state *state)
        if (clean_index(&head, &head))
                die(_("failed to clean index"));
 
+       if (state->rebasing) {
+               FILE *fp = xfopen(am_path(state, "rewritten"), "a");
+
+               assert(!is_null_oid(&state->orig_commit));
+               fprintf(fp, "%s ", oid_to_hex(&state->orig_commit));
+               fprintf(fp, "%s\n", oid_to_hex(&head));
+               fclose(fp);
+       }
+
        am_next(state);
        am_load(state);
        am_run(state, 0);