3 test_description='Test "contains" argument behavior'
7 test_expect_success 'setup ' '
9 echo "this is a test" >file &&
11 git commit -am "tag test" &&
16 test_expect_success 'tag --contains <existent_tag>' '
17 git tag --contains "v1.0" >actual &&
22 test_expect_success 'tag --contains <inexistent_tag>' '
23 test_must_fail git tag --contains "notag" 2>actual &&
24 test_i18ngrep "error" actual
27 test_expect_success 'tag --no-contains <existent_tag>' '
28 git tag --no-contains "v1.1" >actual &&
29 test_line_count = 0 actual
32 test_expect_success 'tag --no-contains <inexistent_tag>' '
33 test_must_fail git tag --no-contains "notag" 2>actual &&
34 test_i18ngrep "error" actual
37 test_expect_success 'tag usage error' '
38 test_must_fail git tag --noopt 2>actual &&
39 test_i18ngrep "usage" actual
42 test_expect_success 'branch --contains <existent_commit>' '
43 git branch --contains "master" >actual &&
44 test_i18ngrep "master" actual
47 test_expect_success 'branch --contains <inexistent_commit>' '
48 test_must_fail git branch --no-contains "nocommit" 2>actual &&
49 test_i18ngrep "error" actual
52 test_expect_success 'branch --no-contains <existent_commit>' '
53 git branch --no-contains "master" >actual &&
54 test_line_count = 0 actual
57 test_expect_success 'branch --no-contains <inexistent_commit>' '
58 test_must_fail git branch --no-contains "nocommit" 2>actual &&
59 test_i18ngrep "error" actual
62 test_expect_success 'branch usage error' '
63 test_must_fail git branch --noopt 2>actual &&
64 test_i18ngrep "usage" actual
67 test_expect_success 'for-each-ref --contains <existent_object>' '
68 git for-each-ref --contains "master" >actual &&
69 test_line_count = 3 actual
72 test_expect_success 'for-each-ref --contains <inexistent_object>' '
73 test_must_fail git for-each-ref --no-contains "noobject" 2>actual &&
74 test_i18ngrep "error" actual
77 test_expect_success 'for-each-ref --no-contains <existent_object>' '
78 git for-each-ref --no-contains "master" >actual &&
79 test_line_count = 0 actual
82 test_expect_success 'for-each-ref --no-contains <inexistent_object>' '
83 test_must_fail git for-each-ref --no-contains "noobject" 2>actual &&
84 test_i18ngrep "error" actual
87 test_expect_success 'for-each-ref usage error' '
88 test_must_fail git for-each-ref --noopt 2>actual &&
89 test_i18ngrep "usage" actual