From fdb2732abbc3fe5394208668030c194c178a3985 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 14 Feb 2013 00:00:00 +0000 Subject: Use batch-check to use only the remote_has commits we also have locally --- git-remote-gcrypt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/git-remote-gcrypt b/git-remote-gcrypt index be3a4a7..909aa25 100755 --- a/git-remote-gcrypt +++ b/git-remote-gcrypt @@ -249,10 +249,8 @@ pack_hash() # Pass the branch/ref by pipe to git safe_git_rev_parse() { - local out_= - out_=$(xecho "$1" | git cat-file --batch-check) - out_=${out_%%*missing} - xecho "${out_%% *}" + git cat-file --batch-check 2>/dev/null | + xgrep -v "missing" | cut -f 1 -d ' ' } check_recipients() @@ -446,8 +444,9 @@ do_push() trap 'rm -f "$TmpPack_Encrypted" "$TmpObjlist"' EXIT if isnonnull "$Branchlist" then - remote_has=$(xecho "$Branchlist" | - cut -f 1 -d ' ' | sed -e 's/^\(.\)/^&/') + # filter through batch-check to mark only the commits we have + remote_has=$(xecho "$Branchlist" | cut -f 1 -d ' ' | + safe_git_rev_parse | sed -e 's/^\(.\)/^&/') fi while read line_ # from << @@ -458,7 +457,7 @@ do_push() then remote_want=$(append "$remote_want" "$prefix_") Branchlist=$(append "$Branchlist" \ - "$(safe_git_rev_parse "$prefix_") $suffix_") + "$(xecho "$prefix_" | safe_git_rev_parse) $suffix_") else # Mark branch for deletion Branchlist=$(append "$Branchlist" "$del_hash $suffix_") -- cgit v1.1