add GETINFO to external protocol (for ronnypfa)

External special remotes can now add info to `git annex info $remote`, by
replying to the GETINFO message.

Had to generalize some helpers to allow consuming multiple messages from
the remote.

The code added to Remote/* here is AGPL licensed, thus changed the license
of the files.

This commit was sponsored by Jake Vosloo on Patreon.
This commit is contained in:
Joey Hess 2018-06-08 11:52:20 -04:00
parent 8397151b2b
commit c3c28f7617
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 149 additions and 67 deletions

View file

@ -285,6 +285,15 @@ while read line; do
fi
;;
# This is optional, only provided as an example.
GETINFO)
echo INFOFIELD "repository location"
echo INFOVALUE "$mydirectory"
echo INFOFIELD "login"
echo INFOVALUE "$MYLOGIN"
echo INFOEND
;;
*)
echo UNSUPPORTED-REQUEST
;;