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-loose.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-loose.sh` 30 lines ยท 802 bytes Raw Blame History 1 # Support routines for hand-crafting loose objects. 2 3 # Write a loose object into the odb at $1, with object type $2 and contents 4 # from stdin. Writes the oid to stdout. Example: 5 # 6 # oid=$(echo foo | loose_obj .git/objects blob) 7 # 8 loose_obj () { 9 cat >tmp_loose.content && 10 size=$(wc -c tmp_loose.raw && 17 18 oid=$(test-tool $test_hash_algo tmp_loose.zlib && 25 mkdir -p "$dir" && 26 mv tmp_loose.zlib "$file" && 27 28 rm tmp_loose.raw tmp_loose.content && 29 echo "$oid" 30 }