aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@localhost>2013-01-25 10:36:22 +0700
committerroot <root@localhost>2013-01-25 10:36:22 +0700
commite1f60d45bbaca68179459944f5a518ceb6f4700d (patch)
tree13bf57af6b66f5287b20546311f29c7e54c821d9
parentbc1c097c42242f75ecc942a1776524dd111e1d2d (diff)
downloadgit-remote-gcrypt-e1f60d45bbaca68179459944f5a518ceb6f4700d.zip
git-remote-gcrypt-e1f60d45bbaca68179459944f5a518ceb6f4700d.tar.gz
git-remote-gcrypt-e1f60d45bbaca68179459944f5a518ceb6f4700d.tar.bz2
Encrypt and hash the new packfile streamingly
-rwxr-xr-xgit-remote-gcrypt14
1 files changed, 9 insertions, 5 deletions
diff --git a/git-remote-gcrypt b/git-remote-gcrypt
index 30f6840..e0b1133 100755
--- a/git-remote-gcrypt
+++ b/git-remote-gcrypt
@@ -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"