| 216 | } |
| 217 | |
| 218 | int 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 | |
| 244 | int GitRev::GetCommit(const CString& refname, bool allowTree /* false */) |
| 245 | { |
nothing calls this directly
no test coverage detected