The special regexp caracters ('{', '}') from gerrit pattern are causing
an exception. As ${username} and ${shardeduserid} are only meaningful to
gerrit, we substitute them for placeholders.
Unlike what is done in RefPatternMatcher.ExpandParameters, the
placeholder does not contain ':' but '_' to be correctly evaluated by
Repository.isValidRefName later on.
Bug: Issue 3340
Change-Id: Iedf3022f6ce3068f7e9534f224cf05bb99b0f970