~ubuntu-branches/ubuntu/edgy/git-core/edgy-backports

« back to all changes in this revision

Viewing changes to t/t4103-apply-binary.sh

  • Committer: Package Import Robot
  • Author(s): LaMont Jones
  • Date: 2007-11-29 07:28:44 UTC
  • mfrom: (8.1.2 dapper-backports)
  • Revision ID: package-import@ubuntu.com-20071129072844-umsb7y3140yhxkth
Tags: 1:1.5.3.6-1.1~dapper1
* backport to dapper et al.
  - debian/rules changes to support source:Upstream-Version for old dpkg.
  - allow asciidoc (>7.0.2-3)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
# Copyright (c) 2005 Junio C Hamano
4
4
#
5
5
 
6
 
test_description='git-apply handling binary patches
 
6
test_description='git apply handling binary patches
7
7
 
8
8
'
9
9
. ./test-lib.sh
20
20
cat file1 >file2
21
21
cat file1 >file4
22
22
 
23
 
git-update-index --add --remove file1 file2 file4
 
23
git update-index --add --remove file1 file2 file4
24
24
git-commit -m 'Initial Version' 2>/dev/null
25
25
 
26
26
git-checkout -b binary
27
27
tr 'x' '\0' <file1 >file3
28
28
cat file3 >file4
29
 
git-add file2
 
29
git add file2
30
30
tr '\0' 'v' <file3 >file1
31
31
rm -f file2
32
 
git-update-index --add --remove file1 file2 file3 file4
 
32
git update-index --add --remove file1 file2 file3 file4
33
33
git-commit -m 'Second Version'
34
34
 
35
 
git-diff-tree -p master binary >B.diff
36
 
git-diff-tree -p -C master binary >C.diff
 
35
git diff-tree -p master binary >B.diff
 
36
git diff-tree -p -C master binary >C.diff
37
37
 
38
 
git-diff-tree -p --binary master binary >BF.diff
39
 
git-diff-tree -p --binary -C master binary >CF.diff
 
38
git diff-tree -p --binary master binary >BF.diff
 
39
git diff-tree -p --binary -C master binary >CF.diff
40
40
 
41
41
test_expect_success 'stat binary diff -- should not fail.' \
42
42
        'git-checkout master
43
 
         git-apply --stat --summary B.diff'
 
43
         git apply --stat --summary B.diff'
44
44
 
45
45
test_expect_success 'stat binary diff (copy) -- should not fail.' \
46
46
        'git-checkout master
47
 
         git-apply --stat --summary C.diff'
 
47
         git apply --stat --summary C.diff'
48
48
 
49
49
test_expect_failure 'check binary diff -- should fail.' \
50
50
        'git-checkout master
51
 
         git-apply --check B.diff'
 
51
         git apply --check B.diff'
52
52
 
53
53
test_expect_failure 'check binary diff (copy) -- should fail.' \
54
54
        'git-checkout master
55
 
         git-apply --check C.diff'
 
55
         git apply --check C.diff'
56
56
 
57
57
test_expect_failure 'check incomplete binary diff with replacement -- should fail.' \
58
58
        'git-checkout master
59
 
         git-apply --check --allow-binary-replacement B.diff'
 
59
         git apply --check --allow-binary-replacement B.diff'
60
60
 
61
61
test_expect_failure 'check incomplete binary diff with replacement (copy) -- should fail.' \
62
62
        'git-checkout master
63
 
         git-apply --check --allow-binary-replacement C.diff'
 
63
         git apply --check --allow-binary-replacement C.diff'
64
64
 
65
65
test_expect_success 'check binary diff with replacement.' \
66
66
        'git-checkout master
67
 
         git-apply --check --allow-binary-replacement BF.diff'
 
67
         git apply --check --allow-binary-replacement BF.diff'
68
68
 
69
69
test_expect_success 'check binary diff with replacement (copy).' \
70
70
        'git-checkout master
71
 
         git-apply --check --allow-binary-replacement CF.diff'
 
71
         git apply --check --allow-binary-replacement CF.diff'
72
72
 
73
73
# Now we start applying them.
74
74
 
80
80
 
81
81
test_expect_failure 'apply binary diff -- should fail.' \
82
82
        'do_reset
83
 
         git-apply B.diff'
 
83
         git apply B.diff'
84
84
 
85
85
test_expect_failure 'apply binary diff -- should fail.' \
86
86
        'do_reset
87
 
         git-apply --index B.diff'
88
 
 
89
 
test_expect_failure 'apply binary diff (copy) -- should fail.' \
90
 
        'do_reset
91
 
         git-apply C.diff'
92
 
 
93
 
test_expect_failure 'apply binary diff (copy) -- should fail.' \
94
 
        'do_reset
95
 
         git-apply --index C.diff'
 
87
         git apply --index B.diff'
 
88
 
 
89
test_expect_failure 'apply binary diff (copy) -- should fail.' \
 
90
        'do_reset
 
91
         git apply C.diff'
 
92
 
 
93
test_expect_failure 'apply binary diff (copy) -- should fail.' \
 
94
        'do_reset
 
95
         git apply --index C.diff'
96
96
 
97
97
test_expect_success 'apply binary diff without replacement.' \
98
98
        'do_reset
99
 
         git-apply BF.diff'
 
99
         git apply BF.diff'
100
100
 
101
101
test_expect_success 'apply binary diff without replacement (copy).' \
102
102
        'do_reset
103
 
         git-apply CF.diff'
 
103
         git apply CF.diff'
104
104
 
105
105
test_expect_success 'apply binary diff.' \
106
106
        'do_reset
107
 
         git-apply --allow-binary-replacement --index BF.diff &&
108
 
         test -z "$(git-diff --name-status binary)"'
 
107
         git apply --allow-binary-replacement --index BF.diff &&
 
108
         test -z "$(git diff --name-status binary)"'
109
109
 
110
110
test_expect_success 'apply binary diff (copy).' \
111
111
        'do_reset
112
 
         git-apply --allow-binary-replacement --index CF.diff &&
113
 
         test -z "$(git-diff --name-status binary)"'
 
112
         git apply --allow-binary-replacement --index CF.diff &&
 
113
         test -z "$(git diff --name-status binary)"'
114
114
 
115
115
test_done