]> git.ipfire.org Git - thirdparty/git.git/commit - refs.c
refs.c: allow passing NULL to ref_transaction_free
authorRonnie Sahlberg <sahlberg@google.com>
Fri, 20 Jun 2014 14:42:45 +0000 (07:42 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 14 Jul 2014 18:54:40 +0000 (11:54 -0700)
commit1b07255c95cdf2f7dbe7989a734248f60799f506
treec05e1687a763576505059600c7303d7711e5da92
parentf1c9350ad784eca97184b73973fad353baa99a1d
refs.c: allow passing NULL to ref_transaction_free

Allow ref_transaction_free(NULL) as a no-op. This makes ref_transaction_free
easier to use and more similar to plain 'free'.

In particular, it lets us rollback unconditionally as part of cleanup code
after setting 'transaction = NULL' if a transaction has been committed or
rolled back already.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
refs.c