]> Nutra Git (v2) - gamesguru/git-remote-gcrypt.git/commitdiff
Encrypt and hash the new packfile streamingly
authorroot <root@localhost>
Fri, 25 Jan 2013 03:36:22 +0000 (10:36 +0700)
committerroot <root@localhost>
Fri, 25 Jan 2013 03:36:22 +0000 (10:36 +0700)
git-remote-gcrypt

index 30f68407645abdfd9320be017bb3a42fb75a4a79..e0b113324b795950b345c5ed0b3fede66f5317bb 100755 (executable)
@@ -732,11 +732,15 @@ EOF
        if [ -s "$tmp_objlist" ]
        then
                key_=$(genkey "$Packkey_bytes")
-               (GIT_ALTERNATE_OBJECT_DIRECTORIES=$Localdir \
-                       git pack-objects --stdout < "$tmp_objlist" ||
-                       echo_kill "git pack-objects failed!") |
-                       ENCRYPT "$key_" > "$tmp_encrypted"
-               pack_id=$(gpg_hash "$Hashtype" < "$tmp_encrypted")
+               pack_id=$(\
+                       {
+                               GIT_ALTERNATE_OBJECT_DIRECTORIES=$Localdir \
+                               git pack-objects --stdout < "$tmp_objlist" ||
+                               echo_kill "git pack-objects failed!"
+                       } | {
+                               ENCRYPT "$key_" ||
+                               echo_kill "gpg -c failed!"
+                       } | tee "$tmp_encrypted" | gpg_hash "$Hashtype")
 
                append_to @Packlist "pack :${Hashtype}:$pack_id $key_"
                if isnonnull "$r_pack_delete"