summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorRonnie Sahlberg <sahlberg@google.com>2014-04-16 22:27:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-09-03 17:04:08 (GMT)
commit8c8bdc0d3582e42c13815a191344b1aa3e06c792 (patch)
tree8303c86ee46b8e76a2082f67fa275ec0149fde0e /builtin
parentb416af5bcdca3ac8426220f09efbfca2f1bec6e0 (diff)
downloadgit-8c8bdc0d3582e42c13815a191344b1aa3e06c792.zip
git-8c8bdc0d3582e42c13815a191344b1aa3e06c792.tar.gz
git-8c8bdc0d3582e42c13815a191344b1aa3e06c792.tar.bz2
refs.c: update ref_transaction_delete to check for error and return status
Change ref_transaction_delete() to do basic error checking and return non-zero on error. Update all callers to check the return for ref_transaction_delete(). There are currently no conditions in _delete that will return error but there will be in the future. Add an err argument that will be updated on failure. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/update-ref.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/update-ref.c b/builtin/update-ref.c
index 41121fa..7c9c248 100644
--- a/builtin/update-ref.c
+++ b/builtin/update-ref.c
@@ -258,8 +258,9 @@ static const char *parse_cmd_delete(struct strbuf *input, const char *next)
if (*next != line_termination)
die("delete %s: extra input: %s", refname, next);
- ref_transaction_delete(transaction, refname, old_sha1,
- update_flags, have_old);
+ if (ref_transaction_delete(transaction, refname, old_sha1,
+ update_flags, have_old, &err))
+ die("%s", err.buf);
update_flags = 0;
free(refname);