3 test_description='test globbing (and noglob) of pathspec limiting'
6 test_expect_success 'create commits with glob characters' '
7 test_commit unrelated bar &&
8 test_commit vanilla foo &&
9 test_commit star "f*" &&
10 test_commit bracket "f[o][o]"
13 test_expect_success 'vanilla pathspec matches literally' '
14 echo vanilla >expect &&
15 git log --format=%s -- foo >actual &&
16 test_cmp expect actual
19 test_expect_success 'star pathspec globs' '
20 cat >expect <<-\EOF &&
25 git log --format=%s -- "f*" >actual &&
26 test_cmp expect actual
29 test_expect_success 'bracket pathspec globs and matches literal brackets' '
30 cat >expect <<-\EOF &&
34 git log --format=%s -- "f[o][o]" >actual &&
35 test_cmp expect actual
38 test_expect_success 'no-glob option matches literally (vanilla)' '
39 echo vanilla >expect &&
40 git --literal-pathspecs log --format=%s -- foo >actual &&
41 test_cmp expect actual
44 test_expect_success 'no-glob option matches literally (star)' '
46 git --literal-pathspecs log --format=%s -- "f*" >actual &&
47 test_cmp expect actual
50 test_expect_success 'no-glob option matches literally (bracket)' '
51 echo bracket >expect &&
52 git --literal-pathspecs log --format=%s -- "f[o][o]" >actual &&
53 test_cmp expect actual
56 test_expect_success 'no-glob environment variable works' '
58 GIT_LITERAL_PATHSPECS=1 git log --format=%s -- "f*" >actual &&
59 test_cmp expect actual