Preconditions.checkArgument(!ObjectId.NULL.equals(commitId),
"Cannot merge a NULL commit.");
Preconditions.checkArgument(repository().commitExists(commitId),
"Not a valid commit: " + commitId.toString());
subProgress.started();
if (ObjectId.NULL.equals(headRef.getObjectId())) {
// Fast-forward
if (headRef instanceof SymRef) {
final String currentBranch = ((SymRef) headRef).getTarget();
command(UpdateRef.class).setName(currentBranch).setNewValue(commitId)