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

« back to all changes in this revision

Viewing changes to t/t2101-update-index-reupdate.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:
3
3
# Copyright (c) 2006 Junio C Hamano
4
4
#
5
5
 
6
 
test_description='git-update-index --again test.
 
6
test_description='git update-index --again test.
7
7
'
8
8
 
9
9
. ./test-lib.sh
15
15
test_expect_success 'update-index --add' \
16
16
        'echo hello world >file1 &&
17
17
         echo goodbye people >file2 &&
18
 
         git-update-index --add file1 file2 &&
19
 
         git-ls-files -s >current &&
 
18
         git update-index --add file1 file2 &&
 
19
         git ls-files -s >current &&
20
20
         cmp current expected'
21
21
 
22
22
test_expect_success 'update-index --again' \
23
23
        'rm -f file1 &&
24
24
        echo hello everybody >file2 &&
25
 
        if git-update-index --again
 
25
        if git update-index --again
26
26
        then
27
27
                echo should have refused to remove file1
28
28
                exit 1
29
29
        else
30
30
                echo happy - failed as expected
31
31
        fi &&
32
 
         git-ls-files -s >current &&
 
32
         git ls-files -s >current &&
33
33
         cmp current expected'
34
34
 
35
35
cat > expected <<\EOF
36
36
100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0       file2
37
37
EOF
38
38
test_expect_success 'update-index --remove --again' \
39
 
        'git-update-index --remove --again &&
40
 
         git-ls-files -s >current &&
 
39
        'git update-index --remove --again &&
 
40
         git ls-files -s >current &&
41
41
         cmp current expected'
42
42
 
43
43
test_expect_success 'first commit' 'git-commit -m initial'
50
50
        'mkdir -p dir1 &&
51
51
        echo hello world >dir1/file3 &&
52
52
        echo goodbye people >file2 &&
53
 
        git-update-index --add file2 dir1/file3 &&
 
53
        git update-index --add file2 dir1/file3 &&
54
54
        echo hello everybody >file2
55
55
        echo happy >dir1/file3 &&
56
 
        git-update-index --again &&
57
 
        git-ls-files -s >current &&
 
56
        git update-index --again &&
 
57
        git ls-files -s >current &&
58
58
        cmp current expected'
59
59
 
60
60
cat > expected <<\EOF
65
65
        'echo not so happy >file2 &&
66
66
        cd dir1 &&
67
67
        cat ../file2 >file3 &&
68
 
        git-update-index --again &&
 
68
        git update-index --again &&
69
69
        cd .. &&
70
 
        git-ls-files -s >current &&
 
70
        git ls-files -s >current &&
71
71
        cmp current expected'
72
72
 
73
73
cat > expected <<\EOF
77
77
test_expect_success 'update-index --update with pathspec' \
78
78
        'echo very happy >file2 &&
79
79
        cat file2 >dir1/file3 &&
80
 
        git-update-index --again dir1/ &&
81
 
        git-ls-files -s >current &&
 
80
        git update-index --again dir1/ &&
 
81
        git ls-files -s >current &&
82
82
        cmp current expected'
83
83
 
84
84
test_done