GitCommands.GitModule.GetSubmodule C# (CSharp) Method

GetSubmodule() public method

public GetSubmodule ( string localPath ) : GitModule
localPath string
return GitModule
        public GitModule GetSubmodule(string localPath)
        {
            return new GitModule(GetSubmoduleFullPath(localPath));
        }

Usage Example

        public static string GetSubmoduleText(GitModule superproject, string name, string hash)
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendLine("Submodule " + name);
            sb.AppendLine();
            GitModule module = superproject.GetSubmodule(name);
            if (module.IsValidGitWorkingDir())
            {
                string error = "";
                CommitData data = CommitData.GetCommitData(module, hash, ref error);
                if (data == null)
                {
                    sb.AppendLine("Commit hash:\t" + hash);
                    return sb.ToString();
                }

                string header = data.GetHeaderPlain();
                string body = "\n" + data.Body.Trim();
                sb.AppendLine(header);
                sb.Append(body);
            }
            else
                sb.AppendLine("Commit hash:\t" + hash);
            return sb.ToString();
        }
All Usage Examples Of GitCommands.GitModule::GetSubmodule
GitModule