From 273fb5f4563322f3c621b40a2a32d892c49b5a35 Mon Sep 17 00:00:00 2001 From: Antoine Beaupré Date: Tue, 22 May 2018 16:53:23 -0400 Subject: ignore unsupported git options It seems that git can send all sorts of options to the remote backends. We don't support any, yet we should at least not crash. The example I stumbled upon is `push.sign=ifAsked` in the config, which translated into the `--sign=ifAsked` option, as in [this bug report](https://git-annex.branchable.com/bugs/gcrypt_repository_not_found/). I haven't tested if it works and the code is rather ugly, but let's take this as a proof of concept for now. --- git-remote-gcrypt | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'git-remote-gcrypt') diff --git a/git-remote-gcrypt b/git-remote-gcrypt index ba75f09..3d4cec5 100755 --- a/git-remote-gcrypt +++ b/git-remote-gcrypt @@ -934,5 +934,23 @@ then exit 100 fi else - gcrypt_main_loop "$@" + for i + do + case "$1" in + -*) + # ignore arbitrary options passed by git + shift + ;; + *) + # first argument is name, second is url + if [ -n "$name" ]; then + name="$1" + else + url="$1" + fi + shift + ;; + esac + done + gcrypt_main_loop "$name" "$url" fi -- cgit v1.2.3