Merge branch 'stable-2.12'

* stable-2.12:
  PatchSetInserter: Always use db from Context
  RefNames#fullName: Don't prepend "refs/heads/" for HEAD
  Mergeability: handle UncheckedExecutionException like ExecutionException

Change-Id: I8a5e136e0b13d66871358aae7b56033ea64a03f2
This commit is contained in:
David Pursehouse
2016-07-15 16:42:27 +09:00
3 changed files with 7 additions and 2 deletions

View File

@@ -16,6 +16,8 @@ package com.google.gerrit.reviewdb.client;
/** Constants and utilities for Gerrit-specific ref names. */
public class RefNames {
public static final String HEAD = "HEAD";
public static final String REFS = "refs/";
public static final String REFS_HEADS = "refs/heads/";
@@ -69,7 +71,8 @@ public class RefNames {
public static final String EDIT_PREFIX = "edit-";
public static String fullName(String ref) {
return ref.startsWith(REFS) ? ref : REFS_HEADS + ref;
return (ref.startsWith(REFS) || ref.equals(HEAD)) ?
ref : REFS_HEADS + ref;
}
public static final String shortName(String ref) {