Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fetch: no redundant error message for atomic fetch
If an error occurs during an atomic fetch, a redundant error message will appear at the end of do_fetch(). It was introduced in b3a8046 (fetch: make `--atomic` flag cover backfilling of tags, 2022-02-17). In function do_fetch(), a failure message is already shown before the retcode is set, so we should not call additional error() at the end of this function. We can remove the redundant error() function, because we know that the function ref_transaction_abort() never fails. While we can find a common pattern for calling ref_transaction_abort() by running command "git grep -A1 ref_transaction_abort", e.g.: if (ref_transaction_abort(transaction, &error)) error("abort: %s", error.buf); We can fix this issue follow this pattern, and the test case "fetch porcelain output (atomic)" in t5574 will also be fixed. If in the future we decide that we don't need to check the return value of the function ref_transaction_abort(), this change can be fixed along with it. Signed-off-by: Jiang Xin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
- Loading branch information