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