Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/lib-bundle.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / lib-bundle.sh` 42 lines ยท 1007 bytes Raw Blame History 1 # Library of git-bundle related functions. 2 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" 7 do 8 :; 9 done 10 cat 11 } 12 13 # Check count of objects in a bundle file. 14 # We can use "--thin" option to check thin pack, which must be fixed by 15 # command `git-index-pack --fix-thin --stdin`. 16 test_bundle_object_count () { 17 thin= 18 if test "$1" = "--thin" 19 then 20 thin=t 21 shift 22 fi 23 if test $# -ne 2 24 then 25 echo >&2 "args should be: " 26 return 1 27 fi 28 bundle=$1 29 pack=$bundle.pack 30 convert_bundle_to_pack <"$bundle" >"$pack" && 31 if test -n "$thin" 32 then 33 mv "$pack" "$bundle.thin.pack" && 34 git index-pack --stdin --fix-thin "$pack" <"$bundle.thin.pack" 35 else 36 git index-pack "$pack" 37 fi || return 1 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" 41 return 1 42 }