aboutsummaryrefslogtreecommitdiff
path: root/t/t6004-rev-list-path-optim.sh
blob: 5182dbb15811ae518c1686c0a8f037a84d3cbd06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

test_description='git-rev-list trivial path optimization test'

. ./test-lib.sh

test_expect_success setup '
echo Hello > a &&
git add a &&
git commit -m "Initial commit" a
'

test_expect_success path-optimization '
    commit=$(echo "Unchanged tree" | git-commit-tree "HEAD^{tree}" -p HEAD) &&
    test $(git-rev-list $commit | wc -l) = 2 &&
    test $(git-rev-list $commit -- . | wc -l) = 1
'

test_done