Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-02-18 04:21:41 +0300
committerJunio C Hamano <gitster@pobox.com>2021-02-18 04:21:41 +0300
commitdadc91ff0c15b655070ad334a27a734e91635bd5 (patch)
treec53f828a0941fae682ee087bd21e935de607e2e5 /t/t3206-range-diff.sh
parent77348b0e6e350ec81b3880f99c6077d165df2276 (diff)
parent1e79f973266cfe0e3bab0e26e869b682078e457d (diff)
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