summaryrefslogtreecommitdiff
path: root/t/t4014-format-patch.sh
diff options
context:
space:
mode:
authorLaurent Arnoud <laurent@spkdev.net>2020-05-22 10:46:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-05-24 23:23:59 (GMT)
commitc28ded83fc95be8157c851c8be179733a7d4b137 (patch)
tree5c406996a33b4b729fd17b88ee342547838e902d /t/t4014-format-patch.sh
parentefcab5b7a3d2ce2ae4bf808b335938098b18d960 (diff)
downloadgit-c28ded83fc95be8157c851c8be179733a7d4b137.zip
git-c28ded83fc95be8157c851c8be179733a7d4b137.tar.gz
git-c28ded83fc95be8157c851c8be179733a7d4b137.tar.bz2
diff: add config option relative
The `diff.relative` boolean option set to `true` shows only changes in the current directory/value specified by the `path` argument of the `relative` option and shows pathnames relative to the aforementioned directory. Teach `--no-relative` to override earlier `--relative` Add for git-format-patch(1) options documentation `--relative` and `--no-relative` Signed-off-by: Laurent Arnoud <laurent@spkdev.net> Acked-by: Đoàn Trần Công Danh <congdanhqx@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4014-format-patch.sh')
-rwxr-xr-xt/t4014-format-patch.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index db7e733..575e079 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -1602,6 +1602,19 @@ test_expect_success 'format patch ignores color.ui' '
test_cmp expect actual
'
+test_expect_success 'format patch respects diff.relative' '
+ rm -rf subdir &&
+ mkdir subdir &&
+ echo other content >subdir/file2 &&
+ git add subdir/file2 &&
+ git commit -F msg &&
+ test_unconfig diff.relative &&
+ git format-patch --relative=subdir --stdout -1 >expect &&
+ test_config diff.relative true &&
+ git -C subdir format-patch --stdout -1 >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'cover letter with invalid --cover-from-description and config' '
test_config branch.rebuild-1.description "config subject