* Handle transaction errors. If we're using batches updates, we want to only * die for generic errors and print the remaining to the user. */
| 271 | * die for generic errors and print the remaining to the user. |
| 272 | */ |
| 273 | static void handle_ref_transaction_error(const char *refname, |
| 274 | struct object_id *new_oid, |
| 275 | struct object_id *old_oid, |
| 276 | const char *new_target, |
| 277 | const char *old_target, |
| 278 | enum ref_transaction_error tx_err, |
| 279 | struct strbuf *err, |
| 280 | struct command_options *opts) |
| 281 | { |
| 282 | if (!tx_err) |
| 283 | return; |
| 284 | |
| 285 | if (tx_err != REF_TRANSACTION_ERROR_GENERIC && opts->allow_update_failures) { |
| 286 | print_rejected_refs(refname, old_oid, new_oid, old_target, |
| 287 | new_target, tx_err, err->buf, NULL); |
| 288 | return; |
| 289 | } |
| 290 | |
| 291 | die("%s", err->buf); |
| 292 | } |
| 293 | |
| 294 | /* |
| 295 | * The following five parse_cmd_*() functions parse the corresponding |
no test coverage detected