]>
Commit | Line | Data |
---|---|---|
13ab4462 JH |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2005 Junio C Hamano | |
4 | # | |
5 | ||
6 | test_description='Test built-in diff output engine. | |
7 | ||
8 | ' | |
9 | . ./test-lib.sh | |
ec1fcc16 | 10 | . ../diff-lib.sh |
13ab4462 JH |
11 | |
12 | echo >path0 'Line 1 | |
13 | Line 2 | |
14 | line 3' | |
15 | cat path0 >path1 | |
16 | chmod +x path1 | |
17 | ||
18 | test_expect_success \ | |
19 | 'update-cache --add two files with and without +x.' \ | |
215a7ad1 | 20 | 'git-update-index --add path0 path1' |
13ab4462 JH |
21 | |
22 | mv path0 path0- | |
23 | sed -e 's/line/Line/' <path0- >path0 | |
24 | chmod +x path0 | |
25 | rm -f path1 | |
26 | test_expect_success \ | |
27 | 'git-diff-files -p after editing work tree.' \ | |
28 | 'git-diff-files -p >current' | |
29 | cat >expected <<\EOF | |
b58f23b3 JH |
30 | diff --git a/path0 b/path0 |
31 | old mode 100644 | |
32 | new mode 100755 | |
13ab4462 JH |
33 | --- a/path0 |
34 | +++ b/path0 | |
35 | @@ -1,3 +1,3 @@ | |
36 | Line 1 | |
37 | Line 2 | |
38 | -line 3 | |
39 | +Line 3 | |
b58f23b3 JH |
40 | diff --git a/path1 b/path1 |
41 | deleted file mode 100755 | |
13ab4462 JH |
42 | --- a/path1 |
43 | +++ /dev/null | |
44 | @@ -1,3 +0,0 @@ | |
45 | -Line 1 | |
46 | -Line 2 | |
47 | -line 3 | |
48 | EOF | |
49 | ||
50 | test_expect_success \ | |
51 | 'validate git-diff-files -p output.' \ | |
ec1fcc16 | 52 | 'compare_diff_patch current expected' |
13ab4462 JH |
53 | |
54 | test_done |