| 376 | } |
| 377 | |
| 378 | std::string Repository::getConfigValue(const std::string& key) |
| 379 | { |
| 380 | git_config* config; |
| 381 | auto error = git_repository_config_snapshot(&config, _repository); |
| 382 | GitException::ThrowOnError(error); |
| 383 | |
| 384 | try |
| 385 | { |
| 386 | const char* value; |
| 387 | auto error = git_config_get_string(&value, config, key.c_str()); |
| 388 | GitException::ThrowOnError(error); |
| 389 | |
| 390 | // Copy the value before free-ing the config |
| 391 | std::string returnValue(value); |
| 392 | |
| 393 | git_config_free(config); |
| 394 | |
| 395 | return returnValue; |
| 396 | } |
| 397 | catch (const GitException& ex) |
| 398 | { |
| 399 | git_config_free(config); |
| 400 | throw ex; |
| 401 | } |
| 402 | } |
| 403 | |
| 404 | void Repository::cleanupState() |
| 405 | { |
no test coverage detected