t4013: add "diff" UI program tests.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Jul 1, 2006 at 22:02 UTC
b319b02e2a75bfe71829cfe1506b86ec7644987d
10 files changed
+263
t/t4013-diff-various.sh
+9
@@ -227,6 +227,15 @@ format-patch --attach --stdout initial..side
227
format-patch --attach --stdout initial..master^
228
format-patch --attach --stdout initial..master
229
230
+diff --abbrev initial..side
231
+diff -r initial..side
232
+diff --stat initial..side
233
+diff -r --stat initial..side
234
+diff initial..side
235
+diff --patch-with-stat initial..side
236
+diff --patch-with-raw initial..side
237
+diff --patch-with-stat -r initial..side
238
+diff --patch-with-raw -r initial..side
239
EOF
240
241
test_done
t/t4013/diff.diff_--abbrev_initial..side
new
+32
@@ -0,0 +1,32 @@
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
+$
t/t4013/diff.diff_--patch-with-raw_-r_initial..side
new
+36
@@ -0,0 +1,36 @@
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
+$
t/t4013/diff.diff_--patch-with-raw_initial..side
new
+36
@@ -0,0 +1,36 @@
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
+$
t/t4013/diff.diff_--patch-with-stat_-r_initial..side
new
+37
@@ -0,0 +1,37 @@
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
+$
t/t4013/diff.diff_--patch-with-stat_initial..side
new
+37
@@ -0,0 +1,37 @@
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
+$
t/t4013/diff.diff_--stat_initial..side
new
+6
@@ -0,0 +1,6 @@
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
+$
t/t4013/diff.diff_-r_--stat_initial..side
new
+6
@@ -0,0 +1,6 @@
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
+$
t/t4013/diff.diff_-r_initial..side
new
+32
@@ -0,0 +1,32 @@
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
+$
t/t4013/diff.diff_initial..side
new
+32
@@ -0,0 +1,32 @@
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
+$