diff options
author | root <root@localhost> | 2012-11-10 13:49:56 +0000 |
---|---|---|
committer | root <root@localhost> | 2012-11-10 13:49:56 +0000 |
commit | 4d1f2999f16d90e58f09fc7031dcd1d751cc461a (patch) | |
tree | 80cbc31b479d7ece84d55da615230a7e18bbd00c /git-remote-gcrypt | |
parent | 0e8b89f2443a9c4851ce402c67078c6d4c3a9ae1 (diff) | |
download | git-remote-gcrypt-4d1f2999f16d90e58f09fc7031dcd1d751cc461a.tar.gz |
Use have_packs+ file directly with grep
Diffstat (limited to 'git-remote-gcrypt')
-rwxr-xr-x | git-remote-gcrypt | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/git-remote-gcrypt b/git-remote-gcrypt index 8d17687..dc05f18 100755 --- a/git-remote-gcrypt +++ b/git-remote-gcrypt @@ -615,7 +615,7 @@ do_fetch() # The PACK id is the hash of the encrypted git packfile. # We only download packs mentioned in the encrypted manifest, # and check their digest when received. - local pack_= packline_= pneed_= phave_= premote_= + local pack_= packline_= pneed_= premote_= ensure_connected @@ -627,10 +627,14 @@ do_fetch() TmpPack_Encrypted="$Localdir/tmp_pack_ENCRYPTED_.$$" - premote_=$(xecho "$Packlist" | cut -f 1-2 -d ' ') # The `+` for $GITCEPTION is pointless but we will be safe for stacking - phave_="$(cat "$Localdir/have_packs+" 2>/dev/null || :)" - pneed_="$(xecho "$premote_" | xgrep -v -x -e "$phave_")" + premote_=$(xecho "$Packlist" | cut -f 1-2 -d ' ') + if [ -s "$Localdir/have_packs+" ] + then + pneed_="$(xecho "$premote_" | xgrep -v -x -f "$Localdir/have_packs+")" + else + pneed_=$premote_ + fi xecho "$pneed_" | while read packline_ do |