git-am support for naked email messages (take 2)
[git/git-svn.git] / t / t4000-diff-format.sh
blobbeb6d8f4877c157bdf9e3efa2c914e74da863cd5
1 #!/bin/sh
3 # Copyright (c) 2005 Junio C Hamano
6 test_description='Test built-in diff output engine.
9 . ./test-lib.sh
10 . ../diff-lib.sh
12 echo >path0 'Line 1
13 Line 2
14 line 3'
15 cat path0 >path1
16 chmod +x path1
18 test_expect_success \
19 'update-cache --add two files with and without +x.' \
20 'git-update-index --add path0 path1'
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
30 diff --git a/path0 b/path0
31 old mode 100644
32 new mode 100755
33 --- a/path0
34 +++ b/path0
35 @@ -1,3 +1,3 @@
36 Line 1
37 Line 2
38 -line 3
39 +Line 3
40 diff --git a/path1 b/path1
41 deleted file mode 100755
42 --- a/path1
43 +++ /dev/null
44 @@ -1,3 +0,0 @@
45 -Line 1
46 -Line 2
47 -line 3
48 EOF
50 test_expect_success \
51 'validate git-diff-files -p output.' \
52 'compare_diff_patch current expected'
54 test_done