#include "revision.h"
#include "log-tree.h"
#include "notes-utils.h"
+#include "rerere.h"
/**
* Returns 1 if the file is empty or does not exist, 0 otherwise.
const char *resolvemsg;
int committer_date_is_author_date;
int ignore_date;
+ int allow_rerere_autoupdate;
const char *sign_commit;
int rebasing;
};
o.verbosity = 0;
if (merge_recursive_generic(&o, our_tree, his_tree, 1, bases, &result)) {
+ rerere(state->allow_rerere_autoupdate);
free(his_tree_name);
return error(_("Failed to merge in the changes."));
}
die_user_resolve(state);
}
+ rerere(0);
+
do_commit(state);
am_next(state);
return 0;
}
+/**
+ * Resets rerere's merge resolution metadata.
+ */
+static void am_rerere_clear(void)
+{
+ struct string_list merge_rr = STRING_LIST_INIT_DUP;
+ int fd = setup_rerere(&merge_rr, 0);
+
+ if (fd < 0)
+ return;
+
+ rerere_clear(&merge_rr);
+ string_list_clear(&merge_rr, 1);
+}
+
/**
* Resume the current am session by skipping the current patch.
*/
{
unsigned char head[GIT_SHA1_RAWSZ];
+ am_rerere_clear();
+
if (get_sha1("HEAD", head))
hashcpy(head, EMPTY_TREE_SHA1_BIN);
return;
}
+ am_rerere_clear();
+
curr_branch = resolve_refdup("HEAD", 0, curr_head, NULL);
has_curr_head = !is_null_sha1(curr_head);
if (!has_curr_head)
N_("lie about committer date")),
OPT_BOOL(0, "ignore-date", &state.ignore_date,
N_("use current timestamp for author date")),
+ OPT_RERERE_AUTOUPDATE(&state.allow_rerere_autoupdate),
{ OPTION_STRING, 'S', "gpg-sign", &state.sign_commit, N_("key-id"),
N_("GPG-sign commits"),
PARSE_OPT_OPTARG, NULL, (intptr_t) "" },