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