aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAntoine Beaupré <anarcat@debian.org>2018-05-22 16:53:23 -0400
committerSean Whitton <spwhitton@spwhitton.name>2018-06-05 15:19:09 +0100
commit273fb5f4563322f3c621b40a2a32d892c49b5a35 (patch)
tree56d12c5917d6b2269be8487bc12dfa2bf91bfa98
parent321550f68e03555ec953b7a4be3974ade70ba1a9 (diff)
downloadgit-remote-gcrypt-273fb5f4563322f3c621b40a2a32d892c49b5a35.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.
-rwxr-xr-xgit-remote-gcrypt20
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