]> git.ipfire.org Git - thirdparty/git.git/blame - t/t4000-diff-format.sh
Show original and resulting blob object info in diff output.
[thirdparty/git.git] / t / t4000-diff-format.sh
CommitLineData
13ab4462
JH
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
ec1fcc16 10. ../diff-lib.sh
13ab4462
JH
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.' \
215a7ad1 20 'git-update-index --add path0 path1'
13ab4462
JH
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
b58f23b3
JH
30diff --git a/path0 b/path0
31old mode 100644
32new 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
40diff --git a/path1 b/path1
41deleted 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
48EOF
49
50test_expect_success \
51 'validate git-diff-files -p output.' \
ec1fcc16 52 'compare_diff_patch current expected'
13ab4462
JH
53
54test_done