]>
Commit | Line | Data |
---|---|---|
60896c7b JH |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2005 Junio C Hamano | |
4 | # | |
5 | ||
6 | test_description='More rename detection tests. | |
7 | ||
8 | The rename detection logic should be able to detect pure rename or | |
9 | copy of symbolic links, but should not produce rename/copy followed | |
10 | by an edit for them. | |
11 | ' | |
12 | . ./test-lib.sh | |
ec1fcc16 | 13 | . ../diff-lib.sh |
60896c7b JH |
14 | |
15 | test_expect_success \ | |
16 | 'prepare reference tree' \ | |
17 | 'echo xyzzy | tr -d '\\\\'012 >yomin && | |
18 | ln -s xyzzy frotz && | |
215a7ad1 | 19 | git-update-index --add frotz yomin && |
60896c7b JH |
20 | tree=$(git-write-tree) && |
21 | echo $tree' | |
22 | ||
23 | test_expect_success \ | |
24 | 'prepare work tree' \ | |
25 | 'mv frotz rezrov && | |
26 | rm -f yomin && | |
27 | ln -s xyzzy nitfol && | |
28 | ln -s xzzzy bozbar && | |
215a7ad1 | 29 | git-update-index --add --remove frotz rezrov nitfol bozbar yomin' |
60896c7b JH |
30 | |
31 | # tree has frotz pointing at xyzzy, and yomin that contains xyzzy to | |
32 | # confuse things. work tree has rezrov (xyzzy) nitfol (xyzzy) and | |
33 | # bozbar (xzzzy). | |
34 | # rezrov and nitfol are rename/copy of frotz and bozbar should be | |
35 | # a new creation. | |
36 | ||
215a7ad1 | 37 | GIT_DIFF_OPTS=--unified=0 git-diff-index -M -p $tree >current |
60896c7b | 38 | cat >expected <<\EOF |
25d5ea41 JH |
39 | diff --git a/bozbar b/bozbar |
40 | new file mode 120000 | |
41 | --- /dev/null | |
42 | +++ b/bozbar | |
43 | @@ -0,0 +1 @@ | |
44 | +xzzzy | |
45 | \ No newline at end of file | |
60896c7b JH |
46 | diff --git a/frotz b/nitfol |
47 | similarity index 100% | |
48 | copy from frotz | |
49 | copy to nitfol | |
50 | diff --git a/frotz b/rezrov | |
51 | similarity index 100% | |
dc938417 LT |
52 | rename from frotz |
53 | rename to rezrov | |
60896c7b JH |
54 | diff --git a/yomin b/yomin |
55 | deleted file mode 100644 | |
56 | --- a/yomin | |
57 | +++ /dev/null | |
58 | @@ -1 +0,0 @@ | |
59 | -xyzzy | |
60 | \ No newline at end of file | |
60896c7b JH |
61 | EOF |
62 | ||
63 | test_expect_success \ | |
64 | 'validate diff output' \ | |
ec1fcc16 | 65 | 'compare_diff_patch current expected' |
60896c7b JH |
66 | |
67 | test_done |