interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / t / t6133-pathspec-rev-dwim.sh

49 lines · 1127 bytes Raw Blame History
1#!/bin/sh
2
3test_description='test dwim of revs versus pathspecs in revision parser'
4
5. ./test-lib.sh
6
7test_expect_success 'setup' '
8 test_commit base &&
9 echo content >"br[ack]ets" &&
10 git add . &&
11 test_tick &&
12 git commit -m brackets
13'
14
15test_expect_success 'non-rev wildcard dwims to pathspec' '
16 git log -- "*.t" >expect &&
17 git log "*.t" >actual &&
18 test_cmp expect actual
19'
20
21test_expect_success 'tree:path with metacharacters dwims to rev' '
22 git show "HEAD:br[ack]ets" -- >expect &&
23 git show "HEAD:br[ack]ets" >actual &&
24 test_cmp expect actual
25'
26
27test_expect_success '^{foo} with metacharacters dwims to rev' '
28 git log "HEAD^{/b.*}" -- >expect &&
29 git log "HEAD^{/b.*}" >actual &&
30 test_cmp expect actual
31'
32
33test_expect_success '@{foo} with metacharacters dwims to rev' '
34 git log "HEAD@{now [or thereabouts]}" -- >expect &&
35 git log "HEAD@{now [or thereabouts]}" >actual &&
36 test_cmp expect actual
37'
38
39test_expect_success ':/*.t from a subdir dwims to a pathspec' '
40 mkdir subdir &&
41 (
42 cd subdir &&
43 git log -- ":/*.t" >expect &&
44 git log ":/*.t" >actual &&
45 test_cmp expect actual
46 )
47'
48
49test_done