diff options
author | Ronnie Sahlberg <sahlberg@google.com> | 2014-04-17 01:21:53 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-09-03 19:04:13 +0200 |
commit | d43f990fac72264c1553beb7dbc6e8e795083d42 (patch) | |
tree | 50444f39e8722dce38c4b8961e4aac9c3de2933e /send-pack.c | |
parent | fast-import.c: change update_branch to use ref transactions (diff) | |
download | git-d43f990fac72264c1553beb7dbc6e8e795083d42.tar.xz git-d43f990fac72264c1553beb7dbc6e8e795083d42.zip |
branch.c: use ref transaction for all ref updates
Change create_branch to use a ref transaction when creating the new branch.
This also fixes a race condition in the old code where two concurrent
create_branch could race since the lock_any_ref_for_update/write_ref_sha1
did not protect against the ref already existing. I.e. one thread could end up
overwriting a branch even if the forcing flag is false.
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 'send-pack.c')
0 files changed, 0 insertions, 0 deletions