improve parsing of shortId to tolerate control characters

Sometimes the Gerrit response has control characters after the URL, as
in http://lvps92-51-163-75.dedicated.hosteurope.de/gerrit-2.9.4/223[K

Change-Id: I51cdb21208ae832107df5771615205d1a46d5c3e
3 files changed