From: Ronnie Sahlberg Date: Mon, 28 Apr 2014 21:36:15 +0000 (-0700) Subject: receive-pack.c: use a reference transaction for updating the refs X-Git-Tag: v2.2.0-rc0~139^2~10 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/6629ea2d4a5faa0a84367f6d4aedba53cb0f26b4?hp=6629ea2d4a5faa0a84367f6d4aedba53cb0f26b4 receive-pack.c: use a reference transaction for updating the refs Wrap all the ref updates inside a transaction. In the new API there is no distinction between failure to lock and failure to write a ref. Both can be permanent (e.g., a ref "refs/heads/topic" is blocking creation of the lock file "refs/heads/topic/1.lock") or transient (e.g., file system full) and there's no clear difference in how the client should respond, so replace the two statuses "failed to lock" and "failed to write" with a single status "failed to update ref". In both cases a more detailed message is sent by sideband to diagnose the problem. Example, before: error: there are still refs under 'refs/heads/topic' remote: error: failed to lock refs/heads/topic To foo ! [remote rejected] HEAD -> topic (failed to lock) After: error: there are still refs under 'refs/heads/topic' remote: error: Cannot lock the ref 'refs/heads/topic'. To foo ! [remote rejected] HEAD -> topic (failed to update ref) Signed-off-by: Ronnie Sahlberg Reviewed-by: Michael Haggerty Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano ---