aboutsummaryrefslogtreecommitdiffhomepage
path: root/git-remote-gcrypt
diff options
context:
space:
mode:
authorroot <root@localhost>2013-02-14 00:00:00 +0000
committerroot <root@localhost>2013-02-14 00:00:00 +0000
commit7eb9620b7af41cc25729afee419262c40a8c5a2b (patch)
tree43b739e69f6a997957b2cb12ea300b3c8f7566b9 /git-remote-gcrypt
parent6d36367de5b00cab133084e92fc9723ec47f40fd (diff)
downloadgit-remote-gcrypt-7eb9620b7af41cc25729afee419262c40a8c5a2b.tar.gz
Fix incompatibilities with bash
Diffstat (limited to 'git-remote-gcrypt')
-rwxr-xr-xgit-remote-gcrypt11
1 files changed, 6 insertions, 5 deletions
diff --git a/git-remote-gcrypt b/git-remote-gcrypt
index 7ab505e..2a47b67 100755
--- a/git-remote-gcrypt
+++ b/git-remote-gcrypt
@@ -170,8 +170,9 @@ PRIVENCRYPT()
PRIVDECRYPT()
{
local STATUS
+ exec 4>&1 &&
STATUS=$(gpg --no-default-keyring --keyring "$CONF_KEYRING" \
- --status-fd 3 -q -d 3>&1 1>&4) 4>&1 &&
+ --status-fd 3 -q -d 3>&1 1>&4) &&
printf "%s" "$STATUS" | grep "^\[GNUPG:\] ENC_TO " >/dev/null &&
(printf "%s" "$STATUS" | grep "^\[GNUPG:\] GOODSIG " >/dev/null || {
echo_info "Failed to verify manifest signature!" && return 1
@@ -283,7 +284,7 @@ ensure_connected()
exit 1
}
rm -f "$TMPMANIFEST_ENC"
- trap EXIT
+ trap 0
MASTERKEY=$(printf "%s\n" "$MANIFEST" | head -n 1)
BRANCHLIST=$(printf "%s\n" "$MANIFEST" | xgrep -E '^[0-9a-f]{40} ')
PACKLIST=$(printf "%s\n" "$MANIFEST" | xgrep "^$PACKPFX")
@@ -362,7 +363,7 @@ do_fetch()
done
rm -f "$TMPPACK_ENCRYPTED"
- trap EXIT
+ trap 0
echo # end with blank line
}
@@ -428,7 +429,7 @@ do_push()
rm -f "$TMPPACK_ENCRYPTED"
rm -f "$TMPMANIFEST"
rm -f "$TMPOBJLIST"
- trap EXIT
+ trap 0
# Update manifest
echo_info "Encrypting manifest to \"$RECIPIENTS\""
@@ -444,7 +445,7 @@ do_push()
PUT_FINAL "$URL"
rm -f "$TMPMANIFEST_ENC"
- trap EXIT
+ trap 0
# ok all updates (not deletes)
printf "%s\n" "$1" | while read LINE