Fix ISE when user provides an ambiguous base revision
Fix ISE when user provides an ambiguous base revision

If the user specifies an abbreviated SHA1 as the base revision e.g. when
creating a branch, it may happen that the SHA1 is ambiguous and hence
cannot be resolved. In this case we should not fail with a 500 Internal
Server Error, but reject the request with a proper error message.

No test, since I don't know how to create ambiguous revisions in a test.

Looking at our logs we can see that this is happening:

org.eclipse.jgit.errors.AmbiguousObjectException: Object abbreviation 74568 is ambiguous
  at org.eclipse.jgit.lib.Repository.resolveAbbreviation(Repository.java:920)
  at org.eclipse.jgit.lib.Repository.resolveSimple(Repository.java:848)
  at org.eclipse.jgit.lib.Repository.resolve(Repository.java:813)
  at org.eclipse.jgit.lib.Repository.resolve(Repository.java:472)
  at com.google.gerrit.server.project.RefUtil.parseBaseRevision(RefUtil.java:43)
  at com.google.gerrit.server.restapi.project.CreateBranch.apply(CreateBranch.java:127)
  at com.google.gerrit.server.restapi.project.CreateBranch.apply(CreateBranch.java:61)
  ...

Release-Notes: skip
Signed-off-by: Edwin Kempin <d43fb6c98c97e553b671ed9a9318100f1de386e7@google.com>
Change-Id: I45a366dd39e081305d83d0151557e9d609327e2e

GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit