1 # Library of git-bundle related functions.
3 # Display the pack data contained in the bundle file, bypassing the
4 # header that contains the signature, prerequisites and references.
5 convert_bundle_to_pack () {
6 while read x && test -n "$x"
13 # Check count of objects in a bundle file.
14 # We can use "--thin" opiton to check thin pack, which must be fixed by
15 # command `git-index-pack --fix-thin --stdin`.
16 test_bundle_object_count () {
18 if test "$1" = "--thin"
25 echo >&2 "args should be: <bundle> <count>"
30 convert_bundle_to_pack <"$bundle" >"$pack" &&
33 mv "$pack" "$bundle.thin.pack" &&
34 git index-pack --stdin --fix-thin "$pack" <"$bundle.thin.pack"
36 git index-pack "$pack"
38 count=$(git show-index <"${pack%pack}idx" | wc -l) &&
39 test $2 = $count && return 0
40 echo >&2 "error: object count for $bundle is $count, not $2"