File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -170,8 +170,30 @@ test_expect_success 'fetching of missing objects' '
170
170
git verify-pack --verbose "$IDX" | grep "$HASH"
171
171
'
172
172
173
+ test_expect_success ' fetching of missing objects from another odb remote' '
174
+ git clone "file://$(pwd)/server" server2 &&
175
+ test_commit -C server2 bar &&
176
+ git -C server2 repack -a -d --write-bitmap-index &&
177
+ HASH2=$(git -C server2 rev-parse bar) &&
178
+
179
+ git -C repo remote add server2 "file://$(pwd)/server2" &&
180
+ git -C repo config odb.magic2.promisorRemote server2 &&
181
+ git -C repo cat-file -p "$HASH2" &&
182
+
183
+ git -C repo fetch server2 &&
184
+ rm -rf repo/.git/objects/* &&
185
+ git -C repo cat-file -p "$HASH2" &&
186
+
187
+ # Ensure that the .promisor file is written, and check that its
188
+ # associated packfile contains the object
189
+ ls repo/.git/objects/pack/pack-*.promisor >promisorlist &&
190
+ test_line_count = 1 promisorlist &&
191
+ IDX=$(cat promisorlist | sed "s/promisor$/idx/") &&
192
+ git verify-pack --verbose "$IDX" | grep "$HASH2"
193
+ '
194
+
173
195
test_expect_success ' rev-list stops traversal at missing and promised commit' '
174
- rm -rf repo &&
196
+ rm -rf repo server server2 &&
175
197
test_create_repo repo &&
176
198
test_commit -C repo foo &&
177
199
test_commit -C repo bar &&
You can’t perform that action at this time.
0 commit comments