Git fork

Merge branch 'jc/diff-test'

* jc/diff-test:
t4013: add "diff" UI program tests.

+263
+9
t/t4013-diff-various.sh
··· 233 233 format-patch --attach --stdout initial..master^ 234 234 format-patch --attach --stdout initial..master 235 235 236 + diff --abbrev initial..side 237 + diff -r initial..side 238 + diff --stat initial..side 239 + diff -r --stat initial..side 240 + diff initial..side 241 + diff --patch-with-stat initial..side 242 + diff --patch-with-raw initial..side 243 + diff --patch-with-stat -r initial..side 244 + diff --patch-with-raw -r initial..side 236 245 EOF 237 246 238 247 test_done
+32
t/t4013/diff.diff_--abbrev_initial..side
··· 1 + $ git diff --abbrev initial..side 2 + diff --git a/dir/sub b/dir/sub 3 + index 35d242b..7289e35 100644 4 + --- a/dir/sub 5 + +++ b/dir/sub 6 + @@ -1,2 +1,4 @@ 7 + A 8 + B 9 + +1 10 + +2 11 + diff --git a/file0 b/file0 12 + index 01e79c3..f4615da 100644 13 + --- a/file0 14 + +++ b/file0 15 + @@ -1,3 +1,6 @@ 16 + 1 17 + 2 18 + 3 19 + +A 20 + +B 21 + +C 22 + diff --git a/file3 b/file3 23 + new file mode 100644 24 + index 0000000..7289e35 25 + --- /dev/null 26 + +++ b/file3 27 + @@ -0,0 +1,4 @@ 28 + +A 29 + +B 30 + +1 31 + +2 32 + $
+36
t/t4013/diff.diff_--patch-with-raw_-r_initial..side
··· 1 + $ git diff --patch-with-raw -r initial..side 2 + :100644 100644 35d242b... 7289e35... M dir/sub 3 + :100644 100644 01e79c3... f4615da... M file0 4 + :000000 100644 0000000... 7289e35... A file3 5 + 6 + diff --git a/dir/sub b/dir/sub 7 + index 35d242b..7289e35 100644 8 + --- a/dir/sub 9 + +++ b/dir/sub 10 + @@ -1,2 +1,4 @@ 11 + A 12 + B 13 + +1 14 + +2 15 + diff --git a/file0 b/file0 16 + index 01e79c3..f4615da 100644 17 + --- a/file0 18 + +++ b/file0 19 + @@ -1,3 +1,6 @@ 20 + 1 21 + 2 22 + 3 23 + +A 24 + +B 25 + +C 26 + diff --git a/file3 b/file3 27 + new file mode 100644 28 + index 0000000..7289e35 29 + --- /dev/null 30 + +++ b/file3 31 + @@ -0,0 +1,4 @@ 32 + +A 33 + +B 34 + +1 35 + +2 36 + $
+36
t/t4013/diff.diff_--patch-with-raw_initial..side
··· 1 + $ git diff --patch-with-raw initial..side 2 + :100644 100644 35d242b... 7289e35... M dir/sub 3 + :100644 100644 01e79c3... f4615da... M file0 4 + :000000 100644 0000000... 7289e35... A file3 5 + 6 + diff --git a/dir/sub b/dir/sub 7 + index 35d242b..7289e35 100644 8 + --- a/dir/sub 9 + +++ b/dir/sub 10 + @@ -1,2 +1,4 @@ 11 + A 12 + B 13 + +1 14 + +2 15 + diff --git a/file0 b/file0 16 + index 01e79c3..f4615da 100644 17 + --- a/file0 18 + +++ b/file0 19 + @@ -1,3 +1,6 @@ 20 + 1 21 + 2 22 + 3 23 + +A 24 + +B 25 + +C 26 + diff --git a/file3 b/file3 27 + new file mode 100644 28 + index 0000000..7289e35 29 + --- /dev/null 30 + +++ b/file3 31 + @@ -0,0 +1,4 @@ 32 + +A 33 + +B 34 + +1 35 + +2 36 + $
+37
t/t4013/diff.diff_--patch-with-stat_-r_initial..side
··· 1 + $ git diff --patch-with-stat -r initial..side 2 + dir/sub | 2 ++ 3 + file0 | 3 +++ 4 + file3 | 4 ++++ 5 + 3 files changed, 9 insertions(+), 0 deletions(-) 6 + 7 + diff --git a/dir/sub b/dir/sub 8 + index 35d242b..7289e35 100644 9 + --- a/dir/sub 10 + +++ b/dir/sub 11 + @@ -1,2 +1,4 @@ 12 + A 13 + B 14 + +1 15 + +2 16 + diff --git a/file0 b/file0 17 + index 01e79c3..f4615da 100644 18 + --- a/file0 19 + +++ b/file0 20 + @@ -1,3 +1,6 @@ 21 + 1 22 + 2 23 + 3 24 + +A 25 + +B 26 + +C 27 + diff --git a/file3 b/file3 28 + new file mode 100644 29 + index 0000000..7289e35 30 + --- /dev/null 31 + +++ b/file3 32 + @@ -0,0 +1,4 @@ 33 + +A 34 + +B 35 + +1 36 + +2 37 + $
+37
t/t4013/diff.diff_--patch-with-stat_initial..side
··· 1 + $ git diff --patch-with-stat initial..side 2 + dir/sub | 2 ++ 3 + file0 | 3 +++ 4 + file3 | 4 ++++ 5 + 3 files changed, 9 insertions(+), 0 deletions(-) 6 + 7 + diff --git a/dir/sub b/dir/sub 8 + index 35d242b..7289e35 100644 9 + --- a/dir/sub 10 + +++ b/dir/sub 11 + @@ -1,2 +1,4 @@ 12 + A 13 + B 14 + +1 15 + +2 16 + diff --git a/file0 b/file0 17 + index 01e79c3..f4615da 100644 18 + --- a/file0 19 + +++ b/file0 20 + @@ -1,3 +1,6 @@ 21 + 1 22 + 2 23 + 3 24 + +A 25 + +B 26 + +C 27 + diff --git a/file3 b/file3 28 + new file mode 100644 29 + index 0000000..7289e35 30 + --- /dev/null 31 + +++ b/file3 32 + @@ -0,0 +1,4 @@ 33 + +A 34 + +B 35 + +1 36 + +2 37 + $
+6
t/t4013/diff.diff_--stat_initial..side
··· 1 + $ git diff --stat initial..side 2 + dir/sub | 2 ++ 3 + file0 | 3 +++ 4 + file3 | 4 ++++ 5 + 3 files changed, 9 insertions(+), 0 deletions(-) 6 + $
+6
t/t4013/diff.diff_-r_--stat_initial..side
··· 1 + $ git diff -r --stat initial..side 2 + dir/sub | 2 ++ 3 + file0 | 3 +++ 4 + file3 | 4 ++++ 5 + 3 files changed, 9 insertions(+), 0 deletions(-) 6 + $
+32
t/t4013/diff.diff_-r_initial..side
··· 1 + $ git diff -r initial..side 2 + diff --git a/dir/sub b/dir/sub 3 + index 35d242b..7289e35 100644 4 + --- a/dir/sub 5 + +++ b/dir/sub 6 + @@ -1,2 +1,4 @@ 7 + A 8 + B 9 + +1 10 + +2 11 + diff --git a/file0 b/file0 12 + index 01e79c3..f4615da 100644 13 + --- a/file0 14 + +++ b/file0 15 + @@ -1,3 +1,6 @@ 16 + 1 17 + 2 18 + 3 19 + +A 20 + +B 21 + +C 22 + diff --git a/file3 b/file3 23 + new file mode 100644 24 + index 0000000..7289e35 25 + --- /dev/null 26 + +++ b/file3 27 + @@ -0,0 +1,4 @@ 28 + +A 29 + +B 30 + +1 31 + +2 32 + $
+32
t/t4013/diff.diff_initial..side
··· 1 + $ git diff initial..side 2 + diff --git a/dir/sub b/dir/sub 3 + index 35d242b..7289e35 100644 4 + --- a/dir/sub 5 + +++ b/dir/sub 6 + @@ -1,2 +1,4 @@ 7 + A 8 + B 9 + +1 10 + +2 11 + diff --git a/file0 b/file0 12 + index 01e79c3..f4615da 100644 13 + --- a/file0 14 + +++ b/file0 15 + @@ -1,3 +1,6 @@ 16 + 1 17 + 2 18 + 3 19 + +A 20 + +B 21 + +C 22 + diff --git a/file3 b/file3 23 + new file mode 100644 24 + index 0000000..7289e35 25 + --- /dev/null 26 + +++ b/file3 27 + @@ -0,0 +1,4 @@ 28 + +A 29 + +B 30 + +1 31 + +2 32 + $