text: public override IList<Ref> Call(){CheckCallable();IDictionary<string, Ref> refList;try{if (listMode == ListMode.HEAD){refList = repo.RefDatabase.GetRefs(Constants.R_HEADS);}else{if (listMode == ListBranchCommand.ListMode.REMOTE){refList = repo.RefDatabase.GetRefs(Constants.R_REMOTES);}else{refList = new Dictionary<string, Ref>(repo.RefDatabase.GetRefs(Constants.R_HEADS));refList.PutAll(repo.RefDatabase.GetRefs(Constants.R_REMOTES));}}}catch (IOException e){throw new JGitInternalException(e.Message, e);}IList<Ref> resultRefs = new AList<Ref>();Sharpen.Collections.AddAll(resultRefs, refList.Values);resultRefs.Sort(new _IComparer_111());SetCallable(false);return resultRefs;}