summaryrefslogtreecommitdiff
path: root/t/t3206-range-diff.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-02-17 17:21:41 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-02-17 17:21:41 -0800
commitdadc91ff0c15b655070ad334a27a734e91635bd5 (patch)
treec53f828a0941fae682ee087bd21e935de607e2e5 /t/t3206-range-diff.sh
parentMerge branch 'js/range-diff-wo-dotdot' (diff)
parentrange-diff: offer --left-only/--right-only options (diff)
downloadtgif-dadc91ff0c15b655070ad334a27a734e91635bd5.tar.xz
Merge branch 'js/range-diff-one-side-only'
The "git range-diff" command learned "--(left|right)-only" option to show only one side of the compared range. * js/range-diff-one-side-only: range-diff: offer --left-only/--right-only options range-diff: move the diffopt initialization down one layer range-diff: combine all options in a single data structure range-diff: simplify code spawning `git log` range-diff: libify the read_patches() function again range-diff: avoid leaking memory in two error code paths
Diffstat (limited to 't/t3206-range-diff.sh')
-rwxr-xr-xt/t3206-range-diff.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh
index b782d26820..1b26c4c2ef 100755
--- a/t/t3206-range-diff.sh
+++ b/t/t3206-range-diff.sh
@@ -733,4 +733,19 @@ test_expect_success 'format-patch --range-diff with multiple notes' '
test_cmp expect actual
'
+test_expect_success '--left-only/--right-only' '
+ git switch --orphan left-right &&
+ test_commit first &&
+ test_commit unmatched &&
+ test_commit common &&
+ git switch -C left-right first &&
+ git cherry-pick common &&
+
+ git range-diff -s --left-only ...common >actual &&
+ head_oid=$(git rev-parse --short HEAD) &&
+ common_oid=$(git rev-parse --short common) &&
+ echo "1: $head_oid = 2: $common_oid common" >expect &&
+ test_cmp expect actual
+'
+
test_done