builtin/remote.c: rearrange xcalloc arguments
[git.git] / t / t6000-rev-list-misc.sh
blob3794e4ceafc291be5621411f3cad7bf5ef764942
1 #!/bin/sh
3 test_description='miscellaneous rev-list tests'
5 . ./test-lib.sh
7 test_expect_success setup '
8 echo content1 >wanted_file &&
9 echo content2 >unwanted_file &&
10 git add wanted_file unwanted_file &&
11 git commit -m one
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' '
21 mkdir foo &&
22 >foo/file &&
23 git add foo/file &&
24 git commit -m two &&
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 &&
36 git rm -rf . &&
38 mkdir two &&
39 echo frotz >one &&
40 cp one two/three &&
41 git add one two/three &&
42 test_tick &&
43 git commit -m that &&
45 ONE=$(git rev-parse HEAD:one)
46 git rev-list --objects HEAD two >output &&
47 grep "$ONE two/three" output &&
48 ! grep one 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
59 test_expect_success 'propagate uninteresting flag down correctly' '
60 git rev-list --objects ^HEAD^{tree} HEAD^{tree} >actual &&
61 >expect &&
62 test_cmp expect actual
65 test_expect_success 'symleft flag bit is propagated down from tag' '
66 git log --format="%m %s" --left-right v1.0...master >actual &&
67 cat >expect <<-\EOF &&
68 > two
69 > one
70 < another
71 < that
72 EOF
73 test_cmp expect actual
76 test_done