diff options
| author | Junio C Hamano <gitster@pobox.com> | 2020-11-18 13:32:52 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2020-11-18 13:32:52 -0800 |
| commit | 5edc8bdc06db3893ceea52a48edd9b2c34fb64e6 (patch) | |
| tree | d792d1a4fab39ac97f20bf1b831526cfb5ae6807 /t/t4014-format-patch.sh | |
| parent | f8a1cee7b38ef3125ce69dad24af41746a0722a0 (diff) | |
| parent | dc1672dd10dbd7dbc16aa00fe51551295cc51fdc (diff) | |
| download | git-5edc8bdc06db3893ceea52a48edd9b2c34fb64e6.tar.xz | |
Merge branch 'jk/format-patch-output'
"git format-patch --output=there" did not work as expected and
instead crashed. The option is now supported.
* jk/format-patch-output:
format-patch: support --output option
format-patch: tie file-opening logic to output_directory
format-patch: refactor output selection
Diffstat (limited to 't/t4014-format-patch.sh')
| -rwxr-xr-x | t/t4014-format-patch.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 294e76c860..42588bf6e1 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -1919,6 +1919,39 @@ test_expect_success 'format-patch -o overrides format.outputDirectory' ' test_path_is_dir patchset ' +test_expect_success 'format-patch forbids multiple outputs' ' + rm -fr outfile outdir && + test_must_fail \ + git format-patch --stdout --output-directory=outdir && + test_must_fail \ + git format-patch --stdout --output=outfile && + test_must_fail \ + git format-patch --output=outfile --output-directory=outdir +' + +test_expect_success 'configured outdir does not conflict with output options' ' + rm -fr outfile outdir && + test_config format.outputDirectory outdir && + git format-patch --stdout && + test_path_is_missing outdir && + git format-patch --output=outfile && + test_path_is_missing outdir +' + +test_expect_success 'format-patch --output' ' + rm -fr outfile && + git format-patch -3 --stdout HEAD >expect && + git format-patch -3 --output=outfile HEAD && + test_cmp expect outfile +' + +test_expect_success 'format-patch --cover-letter --output' ' + rm -fr outfile && + git format-patch --cover-letter -3 --stdout HEAD >expect && + git format-patch --cover-letter -3 --output=outfile HEAD && + test_cmp expect outfile +' + test_expect_success 'format-patch --base' ' git checkout patchid && |
