]> git.ipfire.org Git - thirdparty/git.git/commit - refs.c
refs.c: pass a list of names to skip to is_refname_available
authorRonnie Sahlberg <sahlberg@google.com>
Thu, 1 May 2014 18:16:07 +0000 (11:16 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Oct 2014 17:47:23 +0000 (10:47 -0700)
commit5fe7d825da8af83a9a3b9bc7f3295f836b6e3a75
tree0702b356afe1a2644fe903b7f75976dad4e1f5ef
parent5d94a1b03318d14847a40f233560c2a87fb16cfa
refs.c: pass a list of names to skip to is_refname_available

Change is_refname_available to take a list of strings to exclude when
checking for conflicts instead of just one single name. We can already
exclude a single name for the sake of renames. This generalizes that support.

ref_transaction_commit already tracks a set of refs that are being deleted
in an array.  This array is then used to exclude refs from being written to
the packed-refs file.  At some stage we will want to change this array to a
struct string_list and then we can pass it to is_refname_available via the
call to lock_ref_sha1_basic.  That will allow us to perform transactions
that perform multiple renames as long as there are no conflicts within the
starting or ending state.

For example, that would allow a single transaction that contains two
renames that are both individually conflicting:

   m -> n/n
   n -> m/m

No functional change intended yet.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c