MCPcopy Create free account
hub / github.com/TortoiseGit/TortoiseGit / GetCommitFromHash_withoutLock

Method GetCommitFromHash_withoutLock

src/Git/GitRev.cpp:218–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218int GitRev::GetCommitFromHash_withoutLock(const CGitHash& hash)
219{
220 GIT_COMMIT commit;
221 try
222 {
223 if (git_get_commit_from_hash(&commit, hash.ToRaw()))
224 {
225 m_sErr = L"git_get_commit_from_hash failed for " + hash.ToString();
226 return -1;
227 }
228 }
229 catch (const char * msg)
230 {
231 m_sErr = L"Could not get commit \"" + hash.ToString() + L"\".\nlibgit reports:\n" + CUnicodeUtils::GetUnicode(msg);
232 return -1;
233 }
234
235 m_objectType = GIT_OBJECT_COMMIT;
236 this->ParserFromCommit(&commit);
237 git_free_commit(&commit);
238
239 m_sErr.Empty();
240
241 return 0;
242}
243
244int GitRev::GetCommit(const CString& refname, bool allowTree /* false */)
245{

Callers

nothing calls this directly

Calls 6

ParserFromCommitMethod · 0.95
git_get_commit_from_hashFunction · 0.85
git_free_commitFunction · 0.85
ToRawMethod · 0.80
ToStringMethod · 0.45
EmptyMethod · 0.45

Tested by

no test coverage detected