diff options
author | Antoine Beaupré <anarcat@debian.org> | 2018-05-22 16:53:23 -0400 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2018-06-05 15:19:09 +0100 |
commit | 273fb5f4563322f3c621b40a2a32d892c49b5a35 (patch) | |
tree | 56d12c5917d6b2269be8487bc12dfa2bf91bfa98 /git-remote-gcrypt | |
parent | 321550f68e03555ec953b7a4be3974ade70ba1a9 (diff) | |
download | git-remote-gcrypt-unsupported-options.tar.gz |
ignore unsupported git optionsunsupported-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.
Diffstat (limited to 'git-remote-gcrypt')
-rwxr-xr-x | git-remote-gcrypt | 20 |
1 files changed, 19 insertions, 1 deletions
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 |