aboutsummaryrefslogtreecommitdiffstats
path: root/t/t3206-range-diff.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-09-09 12:02:24 -0700
committerJunio C Hamano <gitster@pobox.com>2022-09-09 12:02:25 -0700
commit428dce9f4d70b44b61c19c36f3dbe5b3f58aeba2 (patch)
tree0200e7e6172df628030f2695958be23f074f81b0 /t/t3206-range-diff.sh
parentMerge branch 'jk/tempfile-active-flag-cleanup' (diff)
parentrange-diff: optionally accept pathspecs (diff)
downloadgit-428dce9f4d70b44b61c19c36f3dbe5b3f58aeba2.tar.gz
git-428dce9f4d70b44b61c19c36f3dbe5b3f58aeba2.zip
Merge branch 'js/range-diff-with-pathspec'
Allow passing a pathspec to "git range-diff". * js/range-diff-with-pathspec: range-diff: optionally accept pathspecs range-diff: consistently validate the arguments range-diff: reorder argument handling
Diffstat (limited to 't/t3206-range-diff.sh')
-rwxr-xr-xt/t3206-range-diff.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh
index d12e4e4cc6..459beaf7d9 100755
--- a/t/t3206-range-diff.sh
+++ b/t/t3206-range-diff.sh
@@ -162,7 +162,7 @@ test_expect_success 'A^! and A^-<n> (unmodified)' '
'
test_expect_success 'A^{/..} is not mistaken for a range' '
- test_must_fail git range-diff topic^.. topic^{/..} 2>error &&
+ test_must_fail git range-diff topic^.. topic^{/..} -- 2>error &&
test_i18ngrep "not a commit range" error
'
@@ -772,6 +772,17 @@ test_expect_success '--left-only/--right-only' '
test_cmp expect actual
'
+test_expect_success 'ranges with pathspecs' '
+ git range-diff topic...mode-only-change -- other-file >actual &&
+ test_line_count = 2 actual &&
+ topic_oid=$(git rev-parse --short topic) &&
+ mode_change_oid=$(git rev-parse --short mode-only-change^) &&
+ file_change_oid=$(git rev-parse --short mode-only-change) &&
+ grep "$mode_change_oid" actual &&
+ ! grep "$file_change_oid" actual &&
+ ! grep "$topic_oid" actual
+'
+
test_expect_success 'submodule changes are shown irrespective of diff.submodule' '
git init sub-repo &&
test_commit -C sub-repo sub-first &&