Merge "Correct RefUpdateUtil to work for an empty BatchRefUpdate"

This commit is contained in:
Dave Borowitz
2017-11-09 18:06:29 +00:00
committed by Gerrit Code Review
2 changed files with 5 additions and 0 deletions

View File

@@ -57,6 +57,10 @@ public class RefUpdateUtil {
*/
@VisibleForTesting
static void checkResults(BatchRefUpdate bru) throws IOException {
if (bru.getCommands().isEmpty()) {
return;
}
int lockFailure = 0;
int aborted = 0;
int failure = 0;

View File

@@ -53,6 +53,7 @@ public class RefUpdateUtilTest {
@Test
public void checkBatchRefUpdateResults() throws Exception {
checkResults();
checkResults(OK);
checkResults(OK, OK);