~ubuntu-branches/ubuntu/intrepid/git-core/intrepid-updates

« back to all changes in this revision

Viewing changes to t/t4123-apply-shrink.sh

  • Committer: Package Import Robot
  • Author(s): Gerrit Pape
  • Date: 2007-10-04 08:27:01 UTC
  • mfrom: (1.1.23)
  • Revision ID: package-import@ubuntu.com-20071004082701-rsd058ontoqz4i30
Tags: 1:1.5.3.4-1
new upstream point release (closes: #445188).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
test_description='apply a patch that is larger than the preimage'
 
4
 
 
5
. ./test-lib.sh
 
6
 
 
7
cat >F  <<\EOF
 
8
1
 
9
2
 
10
3
 
11
4
 
12
5
 
13
6
 
14
7
 
15
8
 
16
999999
 
17
A
 
18
B
 
19
C
 
20
D
 
21
E
 
22
F
 
23
G
 
24
H
 
25
I
 
26
J
 
27
 
 
28
EOF
 
29
 
 
30
test_expect_success setup '
 
31
 
 
32
        git add F &&
 
33
        mv F G &&
 
34
        sed -e "s/1/11/" -e "s/999999/9/" -e "s/H/HH/" <G >F &&
 
35
        git diff >patch &&
 
36
        sed -e "/^\$/d" <G >F &&
 
37
        git add F
 
38
 
 
39
'
 
40
 
 
41
test_expect_success 'apply should fail gracefully' '
 
42
 
 
43
        if git apply --index patch
 
44
        then
 
45
                echo Oops, should not have succeeded
 
46
                false
 
47
        else
 
48
                status=$?
 
49
                echo "Status was $status"
 
50
                if test -f .git/index.lock
 
51
                then
 
52
                        echo Oops, should not have crashed
 
53
                        false
 
54
                fi
 
55
        fi
 
56
'
 
57
 
 
58
test_done