aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@localhost>2012-11-26 01:53:17 +0400
committerroot <root@localhost>2012-11-26 01:53:17 +0400
commitbc1c097c42242f75ecc942a1776524dd111e1d2d (patch)
tree920bd14e8c00de8d7386a513bd5e3c8fe0012cc6
parent67697c2b32b1b23d213007dd1b3e6545f2a15b71 (diff)
downloadgit-remote-gcrypt-bc1c097c42242f75ecc942a1776524dd111e1d2d.zip
git-remote-gcrypt-bc1c097c42242f75ecc942a1776524dd111e1d2d.tar.gz
git-remote-gcrypt-bc1c097c42242f75ecc942a1776524dd111e1d2d.tar.bz2
Simplify the use of the object list file
-rwxr-xr-xgit-remote-gcrypt15
1 files changed, 8 insertions, 7 deletions
diff --git a/git-remote-gcrypt b/git-remote-gcrypt
index a846ee9..30f6840 100755
--- a/git-remote-gcrypt
+++ b/git-remote-gcrypt
@@ -584,8 +584,7 @@ get_pack_files()
}
# Download and unpack remote packfiles
-# $1 is objects tmpfile
-# $2 return var for list of packfiles to delete
+# $1 return var for list of packfiles to delete
repack_if_needed()
{
local n_= m_= kline_= r_line= r_keep_packlist= r_del_list=
@@ -627,10 +626,10 @@ EOF
(set +f; git verify-pack -v "$Localdir"/pack/*.idx ||
echo_kill "git verify-pack failed!") |
- grep -E '^[0-9a-f]{40}' | cut -f 1 -d ' ' >> "$1"
+ grep -E '^[0-9a-f]{40}' | cut -f 1 -d ' '
Packlist=$r_keep_packlist
- setvar "$2" "$r_del_list"
+ setvar "$1" "$r_del_list"
}
do_capabilities()
@@ -724,12 +723,14 @@ EOF
tmp_encrypted=$(tempname packP)
tmp_objlist=$(tempname objlP)
- xecho "$r_revlist" | git rev-list --objects --stdin -- > "$tmp_objlist"
+ {
+ xfeed "$r_revlist" git rev-list --objects --stdin --
+ repack_if_needed @r_pack_delete
+ } > "$tmp_objlist"
+
# Only send pack if we have any objects to send
if [ -s "$tmp_objlist" ]
then
- repack_if_needed "$tmp_objlist" @r_pack_delete
-
key_=$(genkey "$Packkey_bytes")
(GIT_ALTERNATE_OBJECT_DIRECTORIES=$Localdir \
git pack-objects --stdout < "$tmp_objlist" ||