refs.c: make ref_transaction_begin take an err argument
commit2fe6390b713ecbbe4d3cbc911fec4809ba1e8f91
authorRonnie Sahlberg <sahlberg@google.com>
Mon, 19 May 2014 17:42:34 +0000 (19 10:42 -0700)
committerJonathan Nieder <jrnieder@gmail.com>
Tue, 2 Sep 2014 20:41:22 +0000 (2 13:41 -0700)
tree5a979693e1d3c05ced16fde95b012f6d951e496f
parenta09cd1e5723f4e5c94c7360f7c759a35cd5a4944
refs.c: make ref_transaction_begin take an err argument

Add an err argument to _begin so that on non-fatal failures in future ref
backends we can report a nice error back to the caller.
While _begin can currently never fail for other reasons than OOM, in which
case we die() anyway, we may add other types of backends in the future.
For example, a hypothetical MySQL backend could fail in _begin with
"Can not connect to MySQL server. No route to host".

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
builtin/update-ref.c
refs.c
refs.h