aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@localhost>2013-01-28 07:44:43 +0000
committerroot <root@localhost>2013-01-28 07:44:43 +0000
commit85211abfc06741b745fc055be490d7e7afa18b6a (patch)
tree8a1fb786ff6f6637b3b984ddfebd3b4039920412
parent1d7a760a7eb8e2541d817421b2a0c264d4a92a41 (diff)
downloadgit-remote-gcrypt-85211abfc06741b745fc055be490d7e7afa18b6a.zip
git-remote-gcrypt-85211abfc06741b745fc055be490d7e7afa18b6a.tar.gz
git-remote-gcrypt-85211abfc06741b745fc055be490d7e7afa18b6a.tar.bz2
Use filter_to for pruning Packlist after repack
-rwxr-xr-xgit-remote-gcrypt14
1 files changed, 12 insertions, 2 deletions
diff --git a/git-remote-gcrypt b/git-remote-gcrypt
index d38f889..86dfe44 100755
--- a/git-remote-gcrypt
+++ b/git-remote-gcrypt
@@ -589,7 +589,8 @@ fetch_decrypt_pack()
# $4 to list of packfiles to delete
repack_if_needed()
{
- local pack_= packline_= premote_= key_= pkeep_= n_= m_=
+ local pack_= packline_= premote_= key_= pkeep_= n_= m_= \
+ orig_ifs= kline_= pline_= plist_new=
# $TmpPack_Encrypted set in caller
@@ -642,7 +643,16 @@ repack_if_needed()
Packlist=
else
setvar "$4" "$(xecho "$premote_" | xgrep -v -e "$pkeep_")"
- Packlist=$(xecho "$Packlist" | xgrep -e "$pkeep_")
+ orig_ifs=$IFS
+ IFS=$Newline
+ for kline_ in $pkeep_
+ do
+ IFS=$orig_ifs
+ filter_to @pline_ "pack $kline_ " "$Packlist"
+ append_to @plist_new "$pline_"
+ done
+ IFS=$orig_ifs
+ Packlist=$plist_new
fi
pack_id=$(pack_hash < "$TmpPack_Encrypted")