aboutsummaryrefslogtreecommitdiffhomepage
path: root/git-remote-gcrypt
diff options
context:
space:
mode:
Diffstat (limited to 'git-remote-gcrypt')
-rwxr-xr-xgit-remote-gcrypt40
1 files changed, 29 insertions, 11 deletions
diff --git a/git-remote-gcrypt b/git-remote-gcrypt
index 94e7d58..87db2a1 100755
--- a/git-remote-gcrypt
+++ b/git-remote-gcrypt
@@ -313,7 +313,7 @@ CLEAN_FINAL()
ENCRYPT()
{
- gpg --batch --force-mdc --compress-algo none --passphrase-fd 3 -c 3<<EOF
+ gpg --batch --force-mdc --compress-algo none --trust-model=always --passphrase-fd 3 -c 3<<EOF
$1
EOF
}
@@ -333,7 +333,7 @@ PRIVENCRYPT()
if isnonnull "$Conf_signkey"; then
set -- "$@" -u "$Conf_signkey"
fi
- gpg --compress-algo none -se "$@"
+ gpg --compress-algo none --trust-model=always -se "$@"
}
# $1 is the match for good signature, $2 is the textual signers list
@@ -389,7 +389,8 @@ make_new_repo()
read_config()
{
local recp_= r_keyinfo= r_keyfpr= gpg_list= cap_= conf_part= good_sig= signers_=
- Conf_signkey=$(git config --path user.signingkey || :)
+ Conf_signkey=$(git config --get "remote.$NAME.gcrypt-signingkey" '.+' ||
+ git config --path user.signingkey || :)
conf_part=$(git config --get "remote.$NAME.gcrypt-participants" '.+' ||
git config --get gcrypt.participants '.+' || :)
@@ -783,14 +784,8 @@ cleanup_tmpfiles()
rm -r -f -- "${Tempdir}" >&2
}
-# handle git-remote-helpers protocol
-gcrypt_main_loop()
+setup()
{
- local input_= input_inner= r_args= temp_key=
-
- NAME=$1 # Remote name
- URL=$2 # Remote URL
-
mkdir -p "$Localdir"
# Set up a subdirectory in /tmp
@@ -802,6 +797,17 @@ gcrypt_main_loop()
trap 'exit 1' 1 2 3 15
echo_info "Development version -- Repository format MAY CHANGE"
+}
+
+# handle git-remote-helpers protocol
+gcrypt_main_loop()
+{
+ local input_= input_inner= r_args= temp_key=
+
+ NAME=$1 # Remote name
+ URL=$2 # Remote URL
+
+ setup
while read input_
do
@@ -853,4 +859,16 @@ gcrypt_main_loop()
done
}
-gcrypt_main_loop "$@"
+if [ "x$1" = x--check ]
+then
+ NAME=dummy-gcrypt-check
+ URL=$2
+ setup
+ ensure_connected
+ if iseq "$Did_find_repo" "no"
+ then
+ exit 100
+ fi
+else
+ gcrypt_main_loop "$@"
+fi