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

« back to all changes in this revision

Viewing changes to t/t3300-funny-names.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:
32
32
 
33
33
echo 'just space
34
34
no-funny' >expected
35
 
test_expect_success 'git-ls-files no-funny' \
36
 
        'git-update-index --add "$p0" "$p2" &&
37
 
        git-ls-files >current &&
 
35
test_expect_success 'git ls-files no-funny' \
 
36
        'git update-index --add "$p0" "$p2" &&
 
37
        git ls-files >current &&
38
38
        git diff expected current'
39
39
 
40
 
t0=`git-write-tree`
 
40
t0=`git write-tree`
41
41
echo "$t0" >t0
42
42
 
43
43
cat > expected <<\EOF
45
45
no-funny
46
46
"tabs\t,\" (dq) and spaces"
47
47
EOF
48
 
test_expect_success 'git-ls-files with-funny' \
49
 
        'git-update-index --add "$p1" &&
50
 
        git-ls-files >current &&
 
48
test_expect_success 'git ls-files with-funny' \
 
49
        'git update-index --add "$p1" &&
 
50
        git ls-files >current &&
51
51
        git diff expected current'
52
52
 
53
53
echo 'just space
54
54
no-funny
55
55
tabs    ," (dq) and spaces' >expected
56
 
test_expect_success 'git-ls-files -z with-funny' \
57
 
        'git-ls-files -z | tr \\0 \\012 >current &&
 
56
test_expect_success 'git ls-files -z with-funny' \
 
57
        'git ls-files -z | tr \\0 \\012 >current &&
58
58
        git diff expected current'
59
59
 
60
 
t1=`git-write-tree`
 
60
t1=`git write-tree`
61
61
echo "$t1" >t1
62
62
 
63
63
cat > expected <<\EOF
65
65
no-funny
66
66
"tabs\t,\" (dq) and spaces"
67
67
EOF
68
 
test_expect_success 'git-ls-tree with funny' \
69
 
        'git-ls-tree -r $t1 | sed -e "s/^[^     ]*      //" >current &&
 
68
test_expect_success 'git ls-tree with funny' \
 
69
        'git ls-tree -r $t1 | sed -e "s/^[^     ]*      //" >current &&
70
70
         git diff expected current'
71
71
 
72
72
cat > expected <<\EOF
73
73
A       "tabs\t,\" (dq) and spaces"
74
74
EOF
75
 
test_expect_success 'git-diff-index with-funny' \
76
 
        'git-diff-index --name-status $t0 >current &&
 
75
test_expect_success 'git diff-index with-funny' \
 
76
        'git diff-index --name-status $t0 >current &&
77
77
        git diff expected current'
78
78
 
79
 
test_expect_success 'git-diff-tree with-funny' \
80
 
        'git-diff-tree --name-status $t0 $t1 >current &&
 
79
test_expect_success 'git diff-tree with-funny' \
 
80
        'git diff-tree --name-status $t0 $t1 >current &&
81
81
        git diff expected current'
82
82
 
83
83
echo 'A
84
84
tabs    ," (dq) and spaces' >expected
85
 
test_expect_success 'git-diff-index -z with-funny' \
86
 
        'git-diff-index -z --name-status $t0 | tr \\0 \\012 >current &&
 
85
test_expect_success 'git diff-index -z with-funny' \
 
86
        'git diff-index -z --name-status $t0 | tr \\0 \\012 >current &&
87
87
        git diff expected current'
88
88
 
89
 
test_expect_success 'git-diff-tree -z with-funny' \
90
 
        'git-diff-tree -z --name-status $t0 $t1 | tr \\0 \\012 >current &&
 
89
test_expect_success 'git diff-tree -z with-funny' \
 
90
        'git diff-tree -z --name-status $t0 $t1 | tr \\0 \\012 >current &&
91
91
        git diff expected current'
92
92
 
93
93
cat > expected <<\EOF
94
94
CNUM    no-funny        "tabs\t,\" (dq) and spaces"
95
95
EOF
96
 
test_expect_success 'git-diff-tree -C with-funny' \
97
 
        'git-diff-tree -C --find-copies-harder --name-status \
 
96
test_expect_success 'git diff-tree -C with-funny' \
 
97
        'git diff-tree -C --find-copies-harder --name-status \
98
98
                $t0 $t1 | sed -e 's/^C[0-9]*/CNUM/' >current &&
99
99
        git diff expected current'
100
100
 
101
101
cat > expected <<\EOF
102
102
RNUM    no-funny        "tabs\t,\" (dq) and spaces"
103
103
EOF
104
 
test_expect_success 'git-diff-tree delete with-funny' \
105
 
        'git-update-index --force-remove "$p0" &&
106
 
        git-diff-index -M --name-status \
 
104
test_expect_success 'git diff-tree delete with-funny' \
 
105
        'git update-index --force-remove "$p0" &&
 
106
        git diff-index -M --name-status \
107
107
                $t0 | sed -e 's/^R[0-9]*/RNUM/' >current &&
108
108
        git diff expected current'
109
109
 
113
113
rename from no-funny
114
114
rename to "tabs\t,\" (dq) and spaces"
115
115
EOF
116
 
test_expect_success 'git-diff-tree delete with-funny' \
117
 
        'git-diff-index -M -p $t0 |
 
116
test_expect_success 'git diff-tree delete with-funny' \
 
117
        'git diff-index -M -p $t0 |
118
118
         sed -e "s/index [0-9]*%/index NUM%/" >current &&
119
119
         git diff expected current'
120
120
 
127
127
rename from no-funny
128
128
rename to "tabs\t,\" (dq) and spaces"
129
129
EOF
130
 
test_expect_success 'git-diff-tree delete with-funny' \
131
 
        'git-diff-index -M -p $t0 |
 
130
test_expect_success 'git diff-tree delete with-funny' \
 
131
        'git diff-index -M -p $t0 |
132
132
         sed -e "s/index [0-9]*%/index NUM%/" >current &&
133
133
         git diff expected current'
134
134
 
136
136
 "tabs\t,\" (dq) and spaces"
137
137
 1 files changed, 0 insertions(+), 0 deletions(-)
138
138
EOF
139
 
test_expect_success 'git-diff-tree rename with-funny applied' \
140
 
        'git-diff-index -M -p $t0 |
141
 
         git-apply --stat | sed -e "s/|.*//" -e "s/ *\$//" >current &&
 
139
test_expect_success 'git diff-tree rename with-funny applied' \
 
140
        'git diff-index -M -p $t0 |
 
141
         git apply --stat | sed -e "s/|.*//" -e "s/ *\$//" >current &&
142
142
         git diff expected current'
143
143
 
144
144
cat > expected <<\EOF
146
146
 "tabs\t,\" (dq) and spaces"
147
147
 2 files changed, 3 insertions(+), 3 deletions(-)
148
148
EOF
149
 
test_expect_success 'git-diff-tree delete with-funny applied' \
150
 
        'git-diff-index -p $t0 |
151
 
         git-apply --stat | sed -e "s/|.*//" -e "s/ *\$//" >current &&
 
149
test_expect_success 'git diff-tree delete with-funny applied' \
 
150
        'git diff-index -p $t0 |
 
151
         git apply --stat | sed -e "s/|.*//" -e "s/ *\$//" >current &&
152
152
         git diff expected current'
153
153
 
154
 
test_expect_success 'git-apply non-git diff' \
155
 
        'git-diff-index -p $t0 |
 
154
test_expect_success 'git apply non-git diff' \
 
155
        'git diff-index -p $t0 |
156
156
         sed -ne "/^[-+@]/p" |
157
 
         git-apply --stat | sed -e "s/|.*//" -e "s/ *\$//" >current &&
 
157
         git apply --stat | sed -e "s/|.*//" -e "s/ *\$//" >current &&
158
158
         git diff expected current'
159
159
 
160
160
test_done