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

« back to all changes in this revision

Viewing changes to t/t5510-fetch.sh

  • Committer: Package Import Robot
  • Author(s): Gerrit Pape
  • Date: 2007-04-22 13:31:05 UTC
  • mfrom: (1.1.14)
  • Revision ID: package-import@ubuntu.com-20070422133105-tkmhz328g2p0epz1
Tags: 1:1.5.1.2-1
* new upstream point release.
* debian/changelog.upstream: upstream changes taken from mailing list
  announcement.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
        cd .. &&
23
23
        git clone . two &&
24
24
        cd two &&
25
 
        git repo-config branch.master.remote one &&
26
 
        {
27
 
                echo "URL: ../one/.git/"
28
 
                echo "Pull: refs/heads/master:refs/heads/one"
29
 
        } >.git/remotes/one
 
25
        git config branch.master.remote one &&
 
26
        git config remote.one.url ../one/.git/ &&
 
27
        git config remote.one.fetch refs/heads/master:refs/heads/one &&
30
28
        cd .. &&
31
29
        git clone . three &&
32
30
        cd three &&
33
 
        git repo-config branch.master.remote two &&
34
 
        git repo-config branch.master.merge refs/heads/one &&
 
31
        git config branch.master.remote two &&
 
32
        git config branch.master.merge refs/heads/one &&
 
33
        mkdir -p .git/remotes &&
35
34
        {
36
35
                echo "URL: ../two/.git/"
37
36
                echo "Pull: refs/heads/master:refs/heads/two"
38
37
                echo "Pull: refs/heads/one:refs/heads/one"
39
 
        } >.git/remotes/two
 
38
        } >.git/remotes/two &&
 
39
        cd .. &&
 
40
        git clone . bundle
40
41
'
41
42
 
42
43
test_expect_success "fetch test" '
74
75
 
75
76
        mkdir four &&
76
77
        cd four &&
77
 
        git init-db &&
 
78
        git init &&
78
79
 
79
80
        git fetch .. :track &&
80
81
        git show-ref --verify refs/tags/anno &&
82
83
 
83
84
'
84
85
 
 
86
test_expect_success 'create bundle 1' '
 
87
        cd "$D" &&
 
88
        echo >file updated again by origin &&
 
89
        git commit -a -m "tip" &&
 
90
        git bundle create bundle1 master^..master
 
91
'
 
92
 
 
93
test_expect_success 'header of bundle looks right' '
 
94
        head -n 1 "$D"/bundle1 | grep "^#" &&
 
95
        head -n 2 "$D"/bundle1 | grep "^-[0-9a-f]\{40\} " &&
 
96
        head -n 3 "$D"/bundle1 | grep "^[0-9a-f]\{40\} " &&
 
97
        head -n 4 "$D"/bundle1 | grep "^$"
 
98
'
 
99
 
 
100
test_expect_success 'create bundle 2' '
 
101
        cd "$D" &&
 
102
        git bundle create bundle2 master~2..master
 
103
'
 
104
 
 
105
test_expect_failure 'unbundle 1' '
 
106
        cd "$D/bundle" &&
 
107
        git checkout -b some-branch &&
 
108
        git fetch "$D/bundle1" master:master
 
109
'
 
110
 
 
111
test_expect_success 'bundle 1 has only 3 files ' '
 
112
        cd "$D" &&
 
113
        (
 
114
                while read x && test -n "$x"
 
115
                do
 
116
                        :;
 
117
                done
 
118
                cat
 
119
        ) <bundle1 >bundle.pack &&
 
120
        git index-pack bundle.pack &&
 
121
        verify=$(git verify-pack -v bundle.pack) &&
 
122
        test 4 = $(echo "$verify" | wc -l)
 
123
'
 
124
 
 
125
test_expect_success 'unbundle 2' '
 
126
        cd "$D/bundle" &&
 
127
        git fetch ../bundle2 master:master &&
 
128
        test "tip" = "$(git log -1 --pretty=oneline master | cut -b42-)"
 
129
'
 
130
 
 
131
test_expect_success 'bundle does not prerequisite objects' '
 
132
        cd "$D" &&
 
133
        touch file2 &&
 
134
        git add file2 &&
 
135
        git commit -m add.file2 file2 &&
 
136
        git bundle create bundle3 -1 HEAD &&
 
137
        (
 
138
                while read x && test -n "$x"
 
139
                do
 
140
                        :;
 
141
                done
 
142
                cat
 
143
        ) <bundle3 >bundle.pack &&
 
144
        git index-pack bundle.pack &&
 
145
        test 4 = $(git verify-pack -v bundle.pack | wc -l)
 
146
'
 
147
 
85
148
test_done