walker.c: use ref transaction for ref updates
commitb6b10bb44c31b5a830c1636c7eb8b122f9b67858
authorRonnie Sahlberg <sahlberg@google.com>
Thu, 17 Apr 2014 18:31:06 +0000 (17 11:31 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 3 Sep 2014 17:04:15 +0000 (3 10:04 -0700)
tree55d8c147f8a2fa8db357502bf91d1362b77e9004
parent3f09ba754367fcc0ddad94e22385d80b5f317584
walker.c: use ref transaction for ref updates

Switch to using ref transactions in walker_fetch(). As part of the refactoring
to use ref transactions we also fix a potential memory leak where in the
original code if write_ref_sha1() would fail we would end up returning from
the function without free()ing the msg string.

Note that this function is only called when fetching from a remote HTTP
repository onto the local (most of the time single-user) repository which
likely means that the type of collisions that the previous locking would
protect against and cause the fetch to fail for are even more rare.

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>
walker.c