private GitSubmoduleInfo GetSubmoduleInfo(string submodule)
{
var gitSubmodule =
new GitSubmoduleInfo(this)
{
Initialized = submodule[0] != '-',
UpToDate = submodule[0] != '+',
CurrentCommitGuid = submodule.Substring(1, 40).Trim()
};
var localPath = submodule.Substring(42).Trim();
if (localPath.Contains("("))
{
gitSubmodule.LocalPath = localPath.Substring(0, localPath.IndexOf("(")).TrimEnd();
gitSubmodule.Branch = localPath.Substring(localPath.IndexOf("(")).Trim(new[] { '(', ')', ' ' });
}
else
gitSubmodule.LocalPath = localPath;
return gitSubmodule;
}