Merge branch 'ep/use-git-trace-curl-in-tests'
[alt-git.git] / t / t6133-pathspec-rev-dwim.sh
bloba290ffca0d68dacf5204f4349e473bbbc26efd2f
1 #!/bin/sh
3 test_description='test dwim of revs versus pathspecs in revision parser'
4 . ./test-lib.sh
6 test_expect_success 'setup' '
7 test_commit base &&
8 echo content >"br[ack]ets" &&
9 git add . &&
10 test_tick &&
11 git commit -m brackets
14 test_expect_success 'non-rev wildcard dwims to pathspec' '
15 git log -- "*.t" >expect &&
16 git log "*.t" >actual &&
17 test_cmp expect actual
20 test_expect_success 'tree:path with metacharacters dwims to rev' '
21 git show "HEAD:br[ack]ets" -- >expect &&
22 git show "HEAD:br[ack]ets" >actual &&
23 test_cmp expect actual
26 test_expect_success '^{foo} with metacharacters dwims to rev' '
27 git log "HEAD^{/b.*}" -- >expect &&
28 git log "HEAD^{/b.*}" >actual &&
29 test_cmp expect actual
32 test_expect_success '@{foo} with metacharacters dwims to rev' '
33 git log "HEAD@{now [or thereabouts]}" -- >expect &&
34 git log "HEAD@{now [or thereabouts]}" >actual &&
35 test_cmp expect actual
38 test_expect_success ':/*.t from a subdir dwims to a pathspec' '
39 mkdir subdir &&
41 cd subdir &&
42 git log -- ":/*.t" >expect &&
43 git log ":/*.t" >actual &&
44 test_cmp expect actual
48 test_done