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 &&