public Collection<RevCommit> call() throws GitAPIException,InvalidRefNameException {checkCallable();try {if (repo.exactRef(Constants.R_STASH) == null)return Collections.emptyList();} catch (IOException e) {throw new InvalidRefNameException(MessageFormat.format(JGitText.get().cannotRead, Constants.R_STASH), e);}final ReflogCommand refLog = new ReflogCommand(repo);refLog.setRef(Constants.R_STASH);final Collection<ReflogEntry> stashEntries = refLog.call();if (stashEntries.isEmpty())return Collections.emptyList();final List<RevCommit> stashCommits = new ArrayList<>(stashEntries.size());try (RevWalk walk = new RevWalk(repo)) {for (ReflogEntry entry : stashEntries) {try {stashCommits.add(walk.parseCommit(entry.getNewId()));} catch (IOException e) {throw new JGitInternalException(MessageFormat.format(JGitText.get().cannotReadCommit, entry.getNewId()),e);}}}return stashCommits;}
public override ICollection<RevCommit> Call(){CheckCallable();try{if (repo.GetRef(Constants.R_STASH) == null){return Sharpen.Collections.EmptyList<RevCommit>();}}catch (IOException e){throw new InvalidRefNameException(MessageFormat.Format(JGitText.Get().cannotRead,Constants.R_STASH), e);}ReflogCommand refLog = new ReflogCommand(repo);refLog.SetRef(Constants.R_STASH);ICollection<ReflogEntry> stashEntries = refLog.Call();if (stashEntries.IsEmpty()){return Sharpen.Collections.EmptyList<RevCommit>();}IList<RevCommit> stashCommits = new AList<RevCommit>(stashEntries.Count);RevWalk walk = new RevWalk(repo);walk.SetRetainBody(true);try{foreach (ReflogEntry entry in stashEntries){try{stashCommits.AddItem(walk.ParseCommit(entry.GetNewId()));}catch (IOException e){throw new JGitInternalException(MessageFormat.Format(JGitText.Get().cannotReadCommit, entry.GetNewId()), e);}}}finally{walk.Dispose();}return stashCommits;}