@ -1372,7 +1372,7 @@ static int header_callback(const struct option *opt, const char *arg, int unset)
string_list_clear(&extra_to, 0);
string_list_clear(&extra_to, 0);
string_list_clear(&extra_cc, 0);
string_list_clear(&extra_cc, 0);
} else {
} else {
add_header(arg);
add_header(arg);
}
}
return 0;
return 0;
}
}
@ -1428,7 +1428,7 @@ static struct commit *get_base_commit(const char *base_commit,
base = lookup_commit_reference_by_name(base_commit);
base = lookup_commit_reference_by_name(base_commit);
if (!base)
if (!base)
die(_("unknown commit %s"), base_commit);
die(_("unknown commit %s"), base_commit);
} else if ((base_commit && !strcmp(base_commit, "auto")) || base_auto) {
} else if ((base_commit && !strcmp(base_commit, "auto"))) {
struct branch *curr_branch = branch_get(NULL);
struct branch *curr_branch = branch_get(NULL);
const char *upstream = branch_get_upstream(curr_branch, NULL);
const char *upstream = branch_get_upstream(curr_branch, NULL);
if (upstream) {
if (upstream) {
@ -1732,6 +1732,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
s_r_opt.def = "HEAD";
s_r_opt.def = "HEAD";
s_r_opt.revarg_opt = REVARG_COMMITTISH;
s_r_opt.revarg_opt = REVARG_COMMITTISH;
if (base_auto)
base_commit = "auto";
if (default_attach) {
if (default_attach) {
rev.mime_boundary = default_attach;
rev.mime_boundary = default_attach;
rev.no_inline = 1;
rev.no_inline = 1;
@ -1995,7 +1998,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
}
}
memset(&bases, 0, sizeof(bases));
memset(&bases, 0, sizeof(bases));
if (base_commit || base_auto) {
if (base_commit) {
struct commit *base = get_base_commit(base_commit, list, nr);
struct commit *base = get_base_commit(base_commit, list, nr);
reset_revision_walk();
reset_revision_walk();
clear_object_flags(UNINTERESTING);
clear_object_flags(UNINTERESTING);