public Dictionary<IGitRef, IGitItem> GetSubmoduleItemsForEachRef(string filename, Func<IGitRef, bool> showRemoteRef)
{
string command = GetSortedRefsCommand();
if (command == null)
return new Dictionary<IGitRef, IGitItem>();
filename = filename.ToPosixPath();
var tree = RunGitCmd(command, SystemEncoding);
var refs = GetTreeRefs(tree);
return refs.Where(showRemoteRef).ToDictionary(r => r, r => GetSubmoduleCommitHash(filename, r.Name));
}