Fix dependency resolution when branch name contains ']' character (#2313)