private SuperProjectInfo GetSuperprojectCheckout(Func<IGitRef, bool> showRemoteRef)
{
if (Module.SuperprojectModule == null)
return null;
SuperProjectInfo spi = new SuperProjectInfo();
var currentCheckout = Module.GetSuperprojectCurrentCheckout();
if (currentCheckout.Key == 'U')
{
// return local and remote hashes
var array = Module.SuperprojectModule.GetConflict(Module.SubmodulePath);
spi.Conflict_Base = array.Base.Hash;
spi.Conflict_Local = array.Local.Hash;
spi.Conflict_Remote = array.Remote.Hash;
}
else
{
spi.CurrentBranch = currentCheckout.Value;
}
var refs = Module.SuperprojectModule.GetSubmoduleItemsForEachRef(Module.SubmodulePath, showRemoteRef);
if (refs != null)
{
spi.Refs = refs.Where(a => a.Value != null).GroupBy(a => a.Value.Guid).ToDictionary(gr => gr.Key, gr => gr.Select(a => a.Key).ToList());
}
return spi;
}