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
commit77348b0e6e350ec81b3880f99c6077d165df2276 (patch)
tree19833dbe1ebf5b5300a0a1cc4bc9c8f136b8b617 /t/t3206-range-diff.sh
parent69571dfe219f48614e0e0ae7e28efae0be297764 (diff)
parent2cc543deab38c188906c41e537dc5c7de98b93d7 (diff)
Merge branch 'js/range-diff-wo-dotdot'
There are other ways than ".." for a single token to denote a "commit range", namely "<rev>^!" and "<rev>^-<n>", but "git range-diff" did not understand them. * js/range-diff-wo-dotdot: range-diff(docs): explain how to specify commit ranges range-diff/format-patch: handle commit ranges other than A..B range-diff/format-patch: refactor check for commit range
Diffstat (limited to 't/t3206-range-diff.sh')
-rwxr-xr-xt/t3206-range-diff.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh
index ce24b5d735..b782d26820 100755
--- a/t/t3206-range-diff.sh
+++ b/t/t3206-range-diff.sh
@@ -153,6 +153,19 @@ test_expect_success 'simple A B C (unmodified)' '
test_cmp expect actual
'
+test_expect_success 'A^! and A^-<n> (unmodified)' '
+ git range-diff --no-color topic^! unmodified^-1 >actual &&
+ cat >expect <<-EOF &&
+ 1: $(test_oid t4) = 1: $(test_oid u4) s/12/B/
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'A^{/..} is not mistaken for a range' '
+ test_must_fail git range-diff topic^.. topic^{/..} 2>error &&
+ test_i18ngrep "not a commit range" error
+'
+
test_expect_success 'trivial reordering' '
git range-diff --no-color main topic reordered >actual &&
cat >expect <<-EOF &&