]> git.ipfire.org Git - thirdparty/git.git/commit
convert: add [async_]convert_to_working_tree_ca() variants
authorJeff Hostetler <jeffhost@microsoft.com>
Wed, 16 Dec 2020 14:50:31 +0000 (11:50 -0300)
committerJunio C Hamano <gitster@pobox.com>
Thu, 18 Mar 2021 20:56:40 +0000 (13:56 -0700)
commit55b4ad0eada6924e5e59600266b5d50cbf22733d
tree6d3818516e02d624c61624da6a67c285bab245da
parent38e95844e8f9bfefb34443650e99f740581a394b
convert: add [async_]convert_to_working_tree_ca() variants

Separate the attribute gathering from the actual conversion by adding
_ca() variants of the conversion functions. These variants receive a
precomputed 'struct conv_attrs', not relying, thus, on an index state.
They will be used in a future patch adding parallel checkout support,
for two reasons:

- We will already load the conversion attributes in checkout_entry(),
  before conversion, to decide whether a path is eligible for parallel
  checkout. Therefore, it would be wasteful to load them again later,
  for the actual conversion.

- The parallel workers will be responsible for reading, converting and
  writing blobs to the working tree. They won't have access to the main
  process' index state, so they cannot load the attributes. Instead,
  they will receive the preloaded ones and call the _ca() variant of
  the conversion functions. Furthermore, the attributes machinery is
  optimized to handle paths in sequential order, so it's better to leave
  it for the main process, anyway.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
convert.c
convert.h