diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-13 10:59:52 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-26 16:52:18 +0200 |
commit | 4582c6cb76f4fc7f49025969aba7f8a29a797d64 (patch) | |
tree | f4a6f47e376368bfc240c7ad61c5b83834302c90 /src/buildtool/file_system/git_utils.cpp | |
parent | f0d5b0423de0eb72cda0b5624ac28d72bf65cffd (diff) | |
download | justbuild-4582c6cb76f4fc7f49025969aba7f8a29a797d64.tar.gz |
Fix assignments in conditions
...proposed by clang-tidy.
Enable bugprone-assignment-in-if-condition check.
Diffstat (limited to 'src/buildtool/file_system/git_utils.cpp')
-rw-r--r-- | src/buildtool/file_system/git_utils.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buildtool/file_system/git_utils.cpp b/src/buildtool/file_system/git_utils.cpp index 8fed7d7b..d9833521 100644 --- a/src/buildtool/file_system/git_utils.cpp +++ b/src/buildtool/file_system/git_utils.cpp @@ -32,8 +32,8 @@ constexpr std::size_t kOIDHexSize{GIT_OID_HEXSZ}; auto GitLastError() noexcept -> std::string { #ifndef BOOTSTRAP_BUILD_TOOL - git_error const* err{nullptr}; - if ((err = git_error_last()) != nullptr and err->message != nullptr) { + git_error const* const err = git_error_last(); + if (err != nullptr and err->message != nullptr) { return fmt::format("error code {}: {}", err->klass, err->message); } #endif // BOOTSTRAP_BUILD_TOOL |