@@ -14,6 +14,14 @@ test_bundle_object_count () {
14
14
test " $2 " = $( grep ' ^[0-9a-f]\{40\} ' verify.out | wc -l)
15
15
}
16
16
17
+ convert_bundle_to_pack () {
18
+ while read x && test -n " $x "
19
+ do
20
+ : ;
21
+ done
22
+ cat
23
+ }
24
+
17
25
test_expect_success setup '
18
26
echo >file original &&
19
27
git add file &&
@@ -207,13 +215,7 @@ test_expect_success 'unbundle 1' '
207
215
208
216
test_expect_success ' bundle 1 has only 3 files ' '
209
217
cd "$D" &&
210
- (
211
- while read x && test -n "$x"
212
- do
213
- :;
214
- done
215
- cat
216
- ) <bundle1 >bundle.pack &&
218
+ convert_bundle_to_pack <bundle1 >bundle.pack &&
217
219
git index-pack bundle.pack &&
218
220
test_bundle_object_count bundle.pack 3
219
221
'
@@ -230,13 +232,7 @@ test_expect_success 'bundle does not prerequisite objects' '
230
232
git add file2 &&
231
233
git commit -m add.file2 file2 &&
232
234
git bundle create bundle3 -1 HEAD &&
233
- (
234
- while read x && test -n "$x"
235
- do
236
- :;
237
- done
238
- cat
239
- ) <bundle3 >bundle.pack &&
235
+ convert_bundle_to_pack <bundle3 >bundle.pack &&
240
236
git index-pack bundle.pack &&
241
237
test_bundle_object_count bundle.pack 3
242
238
'
@@ -434,14 +430,31 @@ test_expect_success 'fetch --dry-run' '
434
430
'
435
431
436
432
test_expect_success " should be able to fetch with duplicate refspecs" '
437
- mkdir dups &&
438
- cd dups &&
439
- git init &&
440
- git config branch.master.remote three &&
441
- git config remote.three.url ../three/.git &&
442
- git config remote.three.fetch +refs/heads/*:refs/remotes/origin/* &&
443
- git config --add remote.three.fetch +refs/heads/*:refs/remotes/origin/* &&
444
- git fetch three
433
+ mkdir dups &&
434
+ (
435
+ cd dups &&
436
+ git init &&
437
+ git config branch.master.remote three &&
438
+ git config remote.three.url ../three/.git &&
439
+ git config remote.three.fetch +refs/heads/*:refs/remotes/origin/* &&
440
+ git config --add remote.three.fetch +refs/heads/*:refs/remotes/origin/* &&
441
+ git fetch three
442
+ )
443
+ '
444
+
445
+ test_expect_success ' all boundary commits are excluded' '
446
+ test_commit base &&
447
+ test_commit oneside &&
448
+ git checkout HEAD^ &&
449
+ test_commit otherside &&
450
+ git checkout master &&
451
+ test_tick &&
452
+ git merge otherside &&
453
+ ad=$(git log --no-walk --format=%ad HEAD) &&
454
+ git bundle create twoside-boundary.bdl master --since="$ad" &&
455
+ convert_bundle_to_pack <twoside-boundary.bdl >twoside-boundary.pack &&
456
+ pack=$(git index-pack --fix-thin --stdin <twoside-boundary.pack) &&
457
+ test_bundle_object_count .git/objects/pack/pack-${pack##pack }.pack 3
445
458
'
446
459
447
460
test_done
0 commit comments