sparse-checkout: update working directory in-process for 'init'
commit416adc8711d16c5231693f19ca483dd3d59bef5d
authorDerrick Stolee <dstolee@microsoft.com>
Thu, 21 Nov 2019 22:04:50 +0000 (21 22:04 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 22 Nov 2019 07:11:45 +0000 (22 16:11 +0900)
tree95e680824a7d5869e6dd447d00dab11f653c04fd
parentf75a69f88099689b510c7a7261d637bc7004a749
sparse-checkout: update working directory in-process for 'init'

The 'git sparse-checkout init' subcommand previously wrote directly
to the sparse-checkout file and then updated the working directory.
This may fail if there are modified files not included in the initial
pattern set. However, that left a populated sparse-checkout file.

Use the in-process working directory update to guarantee that the
init subcommand only changes the sparse-checkout file if the working
directory update succeeds.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/sparse-checkout.c