Merge branch 'dl/rebase-with-autobase'
"git rebase" did not work well when format.useAutoBase configuration variable is set, which has been corrected. * dl/rebase-with-autobase: rebase: fix format.useAutoBase breakage format-patch: teach --no-base t4014: use test_config() format-patch: fix indentation t3400: demonstrate failure with format.useAutoBase
This commit is contained in:
@ -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_cc, 0);
|
||||
} else {
|
||||
add_header(arg);
|
||||
add_header(arg);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -1428,7 +1428,7 @@ static struct commit *get_base_commit(const char *base_commit,
|
||||
base = lookup_commit_reference_by_name(base_commit);
|
||||
if (!base)
|
||||
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);
|
||||
const char *upstream = branch_get_upstream(curr_branch, NULL);
|
||||
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.revarg_opt = REVARG_COMMITTISH;
|
||||
|
||||
if (base_auto)
|
||||
base_commit = "auto";
|
||||
|
||||
if (default_attach) {
|
||||
rev.mime_boundary = default_attach;
|
||||
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));
|
||||
if (base_commit || base_auto) {
|
||||
if (base_commit) {
|
||||
struct commit *base = get_base_commit(base_commit, list, nr);
|
||||
reset_revision_walk();
|
||||
clear_object_flags(UNINTERESTING);
|
||||
|
||||
Reference in New Issue
Block a user