@matheusbsbs / matheus-bagliano / commits / 16ad357910
Fork 0

add tests for shallow stuff

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>

Johannes Schindelin committed Oct 30, 2006 at 20:10 UTC 16ad35791099e5da118a0b6cfa0c3db4e2feff81
1 file changed +45
t/t5500-fetch-pack.sh
+45
@@ -128,4 +128,49 @@ pull_to_client 2nd "B" $((64*3))
128
129 pull_to_client 3rd "A" $((1*3)) # old fails
130
131 +test_expect_success "clone shallow" "git-clone --depth 2 . shallow"
132 +
133 +(cd shallow; git-count-objects -v) > count.shallow
134 +
135 +test_expect_success "clone shallow object count" \
136 + "test \"in-pack: 18\" = \"$(grep in-pack count.shallow)\""
137 +
138 +test_expect_success "clone shallow object count (part 2)" \
139 + "test -z \"$(grep -v in-pack count.shallow | sed "s/^.*: 0//")\""
140 +
141 +test_expect_success "fsck in shallow repo" \
142 + "(cd shallow; git-fsck-objects --full)"
143 +
144 +#test_done; exit
145 +
146 +add B66 $B65
147 +add B67 $B66
148 +
149 +test_expect_success "pull in shallow repo" \
150 + "(cd shallow; git pull .. B)"
151 +
152 +(cd shallow; git-count-objects -v) > count.shallow
153 +test_expect_success "clone shallow object count" \
154 + "test \"count: 6\" = \"$(grep count count.shallow)\""
155 +
156 +add B68 $B67
157 +add B69 $B68
158 +
159 +test_expect_success "deepening pull in shallow repo" \
160 + "(cd shallow; git pull --depth 4 .. B)"
161 +
162 +(cd shallow; git-count-objects -v) > count.shallow
163 +test_expect_success "clone shallow object count" \
164 + "test \"count: 12\" = \"$(grep count count.shallow)\""
165 +
166 +test_expect_success "deepening fetch in shallow repo" \
167 + "(cd shallow; git fetch --depth 4 .. A:A)"
168 +
169 +(cd shallow; git-count-objects -v) > count.shallow
170 +test_expect_success "clone shallow object count" \
171 + "test \"count: 18\" = \"$(grep count count.shallow)\""
172 +
173 +test_expect_failure "pull in shallow repo with missing merge base" \
174 + "(cd shallow; git pull --depth 4 .. A)"
175 +
176 test_done