]> Nutra Git (v2) - gamesguru/git-remote-gcrypt.git/commitdiff
Use have_packs+ file directly with grep
authorroot <root@localhost>
Sat, 10 Nov 2012 13:49:56 +0000 (13:49 +0000)
committerroot <root@localhost>
Sat, 10 Nov 2012 13:49:56 +0000 (13:49 +0000)
git-remote-gcrypt

index 8d17687dfdd5e6b5660c8e09126066844b6ab227..dc05f18548a0bbebf5a57e2f6531229ffce83ca5 100755 (executable)
@@ -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