MCPcopy Create free account
hub / github.com/git/git / handle_ref_transaction_error

Function handle_ref_transaction_error

builtin/update-ref.c:273–292  ·  view source on GitHub ↗

* Handle transaction errors. If we're using batches updates, we want to only * die for generic errors and print the remaining to the user. */

Source from the content-addressed store, hash-verified

271 * die for generic errors and print the remaining to the user.
272 */
273static 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

Callers 4

parse_cmd_updateFunction · 0.85
parse_cmd_symref_updateFunction · 0.85
parse_cmd_createFunction · 0.85
parse_cmd_symref_createFunction · 0.85

Calls 2

print_rejected_refsFunction · 0.85
dieFunction · 0.50

Tested by

no test coverage detected