From bc6bf2d7641d6c2450b347d5a0b2f954728bf4d9 Mon Sep 17 00:00:00 2001 From: Alexander Kuleshov Date: Wed, 13 Jan 2016 06:20:11 -0700 Subject: format-patch: introduce format.outputDirectory configuration We can pass -o/--output-directory to the format-patch command to store patches in some place other than the working directory. This patch introduces format.outputDirectory configuration option for same purpose. The case of usage of this configuration option can be convenience to not pass every time -o/--output-directory if an user has pattern to store all patches in the /patches directory for example. The format.outputDirectory has lower priority than command line option, so if user will set format.outputDirectory and pass the command line option, a result will be stored in a directory that passed to command line option. Signed-off-by: Alexander Kuleshov Signed-off-by: Stephen P. Smith Reviewed-by: Eric Sunshine Signed-off-by: Junio C Hamano --- t/t4014-format-patch.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 't') diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 646c4750ec..3b99434e3e 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -1445,4 +1445,19 @@ test_expect_success 'From line has expected format' ' test_cmp from filtered ' +test_expect_success 'format-patch format.outputDirectory option' ' + test_config format.outputDirectory patches && + rm -fr patches && + git format-patch master..side && + test $(git rev-list master..side | wc -l) -eq $(ls patches | wc -l) +' + +test_expect_success 'format-patch -o overrides format.outputDirectory' ' + test_config format.outputDirectory patches && + rm -fr patches patchset && + git format-patch master..side -o patchset && + test_path_is_missing patches && + test_path_is_dir patchset +' + test_done -- cgit v1.2.3