3 test_description='miscellaneous rev-list tests'
7 test_expect_success setup '
8 echo content1 >wanted_file &&
9 echo content2 >unwanted_file &&
10 git add wanted_file unwanted_file &&
14 test_expect_success 'rev-list --objects heeds pathspecs' '
15 git rev-list --objects HEAD -- wanted_file >output &&
16 grep wanted_file output &&
17 ! grep unwanted_file output
20 test_expect_success 'rev-list --objects with pathspecs and deeper paths' '
26 git rev-list --objects HEAD -- foo >output &&
27 grep foo/file output &&
29 git rev-list --objects HEAD -- foo/file >output &&
30 grep foo/file output &&
31 ! grep unwanted_file output
34 test_expect_success 'rev-list --objects with pathspecs and copied files' '
35 git checkout --orphan junio-testcase &&
41 git add one two/three &&
45 ONE=$(git rev-parse HEAD:one)
46 git rev-list --objects HEAD two >output &&
47 grep "$ONE two/three" output &&
51 test_expect_success 'rev-list A..B and rev-list ^A B are the same' '
52 git commit --allow-empty -m another &&
53 git tag -a -m "annotated" v1.0 &&
54 git rev-list --objects ^v1.0^ v1.0 >expect &&
55 git rev-list --objects v1.0^..v1.0 >actual &&
56 test_cmp expect actual