diff options
| author | Junio C Hamano <gitster@pobox.com> | 2022-05-05 14:36:25 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-05-05 14:36:25 -0700 |
| commit | 676cead4550f4d85f0a841493b74e73b54fd19c0 (patch) | |
| tree | 17c925d8a4528478cbb0979be3a01a36fb9dd0f1 /builtin | |
| parent | 09a2302c70a2e1023a16980afa920f36e6aa63ac (diff) | |
| parent | 91f8f7e46fd86f2d20e93e00af451bf75febfe18 (diff) | |
| download | git-676cead4550f4d85f0a841493b74e73b54fd19c0.tar.gz | |
Merge branch 'rs/format-patch-pathspec-fix' into maint
"git format-patch <args> -- <pathspec>" lost the pathspec when
showing the second and subsequent commits, which has been
corrected.
source: <c36896a1-6247-123b-4fa3-b7eb24af1897@web.de>
* rs/format-patch-pathspec-fix:
2.36 format-patch regression fix
Diffstat (limited to 'builtin')
| -rw-r--r-- | builtin/log.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/builtin/log.c b/builtin/log.c index 6696c4cfd0..3ac479bec3 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -1896,6 +1896,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) rev.diff = 1; rev.max_parents = 1; rev.diffopt.flags.recursive = 1; + rev.diffopt.no_free = 1; rev.subject_prefix = fmt_patch_subject_prefix; memset(&s_r_opt, 0, sizeof(s_r_opt)); s_r_opt.def = "HEAD"; @@ -2021,13 +2022,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) if (use_stdout) { setup_pager(); - } else if (rev.diffopt.close_file) { - /* - * The diff code parsed --output; it has already opened the - * file, but we must instruct it not to close after each diff. - */ - rev.diffopt.no_free = 1; - } else { + } else if (!rev.diffopt.close_file) { int saved; if (!output_directory) |
