walk.setRevFilter(MaxCountRevFilter.create(maxCount));
if (!startSpecified) {
try {
ObjectId headId = repo.resolve(Constants.HEAD);
if (headId == null)
throw new NoHeadException(
JGitText.get().noHEADExistsAndNoExplicitStartingRevisionWasSpecified);
add(headId);
} catch (IOException e) {
// all exceptions thrown by add() shouldn't occur and represent
// severe low-level exception which are therefore wrapped