diff options
author | Ronnie Sahlberg <sahlberg@google.com> | 2014-04-16 16:21:53 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-09-03 10:04:13 -0700 |
commit | d43f990fac72264c1553beb7dbc6e8e795083d42 (patch) | |
tree | 50444f39e8722dce38c4b8961e4aac9c3de2933e /config.c | |
parent | de7e86f522ea806ef40b3c9557e040d4109e55fb (diff) | |
download | git-d43f990fac72264c1553beb7dbc6e8e795083d42.tar.gz |
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 'config.c')
0 files changed, 0 insertions, 0 deletions