]> git.ipfire.org Git - thirdparty/git.git/blame - t/t7003-filter-branch.sh
filter-branch: use $(($i+1)) instead of $((i+1))
[thirdparty/git.git] / t / t7003-filter-branch.sh
CommitLineData
6f6826c5
JS
1#!/bin/sh
2
3test_description='git-filter-branch'
4. ./test-lib.sh
5
6make_commit () {
7 lower=$(echo $1 | tr A-Z a-z)
8 echo $lower > $lower
9 git add $lower
aee078bf 10 test_tick
6f6826c5
JS
11 git commit -m $1
12 git tag $1
13}
14
15test_expect_success 'setup' '
16 make_commit A
17 make_commit B
18 git checkout -b branch B
19 make_commit D
20 make_commit E
21 git checkout master
22 make_commit C
23 git checkout branch
24 git merge C
25 git tag F
26 make_commit G
27 make_commit H
28'
29
30H=$(git-rev-parse H)
31
32test_expect_success 'rewrite identically' '
33 git-filter-branch H2
34'
35
36test_expect_success 'result is really identical' '
37 test $H = $(git-rev-parse H2)
38'
39
40test_expect_success 'rewrite, renaming a specific file' '
41 git-filter-branch --tree-filter "mv d doh || :" H3
42'
43
44test_expect_success 'test that the file was renamed' '
45 test d = $(git show H3:doh)
46'
47
48test_done