本文整理汇总了C++中CGitHash::ToRaw方法的典型用法代码示例。如果您正苦于以下问题:C++ CGitHash::ToRaw方法的具体用法?C++ CGitHash::ToRaw怎么用?C++ CGitHash::ToRaw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGitHash
的用法示例。
在下文中一共展示了CGitHash::ToRaw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetParentFromHash
int GitRev::GetParentFromHash(const CGitHash& hash)
{
CAutoLocker lock(g_Git.m_critGitDllSec);
GIT_COMMIT commit;
try
{
g_Git.CheckAndInitDll();
if (git_get_commit_from_hash(&commit, hash.ToRaw()))
{
m_sErr = L"git_get_commit_from_hash failed for " + hash.ToString();
return -1;
}
}
catch (char* msg)
{
m_sErr = L"Could not get parents of commit \"" + hash.ToString() + L"\".\nlibgit reports:\n" + CString(msg);
return -1;
}
this->ParserParentFromCommit(&commit);
git_free_commit(&commit);
this->m_CommitHash=hash;
return 0;
}
示例2: GetCommitFromHash_withoutLock
int GitRev::GetCommitFromHash_withoutLock(const CGitHash& hash)
{
GIT_COMMIT commit;
try
{
if (git_get_commit_from_hash(&commit, hash.ToRaw()))
{
m_sErr = L"git_get_commit_from_hash failed for " + hash.ToString();
return -1;
}
}
catch (char * msg)
{
m_sErr = L"Could not get commit \"" + hash.ToString() + L"\".\nlibgit reports:\n" + CString(msg);
return -1;
}
this->ParserFromCommit(&commit);
git_free_commit(&commit);
m_sErr.Empty();
return 0;
}