public virtual RevCommit TryFastForward(RevCommit newCommit){Ref head = repo.GetRef(Constants.HEAD);if (head == null || head.GetObjectId() == null){throw new RefNotFoundException(MessageFormat.Format(JGitText.Get().refNotResolved, Constants.HEAD));}ObjectId headId = head.GetObjectId();if (headId == null){throw new RefNotFoundException(MessageFormat.Format(JGitText.Get().refNotResolved, Constants.HEAD));}RevCommit headCommit = walk.LookupCommit(headId);if (walk.IsMergedInto(newCommit, headCommit)){return newCommit;}string headName;if (head.IsSymbolic()){headName = head.GetTarget().GetName();}else{headName = "detached HEAD";}return TryFastForward(headName, headCommit, newCommit);}