diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-12-05 15:10:56 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-12-05 15:15:46 +0100 |
commit | 74096dce2ee85ea5df940155fc2717d249e14d80 (patch) | |
tree | 3963eb4383fbcece1b3bed625f093742d5c310b8 | |
parent | ca952159e778f0ed927082832a195842f6229a94 (diff) | |
download | justbuild-74096dce2ee85ea5df940155fc2717d249e14d80.tar.gz |
Common API: correctly report failure
If fetching via the primary API failed and there is no fallback,
we should fail rather than tacitly continuing with the next object
to fetch.
-rw-r--r-- | src/buildtool/execution_api/common/common_api.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/buildtool/execution_api/common/common_api.cpp b/src/buildtool/execution_api/common/common_api.cpp index 87079602..0ad1b09b 100644 --- a/src/buildtool/execution_api/common/common_api.cpp +++ b/src/buildtool/execution_api/common/common_api.cpp @@ -70,8 +70,8 @@ auto CommonRetrieveToFds( fd); // locally we might be able to fallback to Git in native mode try { - if (fallback and not(*fallback)(info, fd)) { - return false; + if (fallback) { + success = (*fallback)(info, fd); } } catch (std::exception const& ex) { Logger::Log(LogLevel::Error, @@ -83,6 +83,9 @@ auto CommonRetrieveToFds( return false; } } + if (not success) { + return false; + } } else { Logger::Log( |