sparse-checkout: check for dirty status
authorDerrick Stolee <dstolee@microsoft.com>
Thu, 21 Nov 2019 22:04:51 +0000 (22:04 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 22 Nov 2019 07:11:45 +0000 (16:11 +0900)
commitcff4e9138d8df45e3b6199171092ee781cdadaeb
treea450b219be113a8b0f9e26265b5ae5fc6dbcd7e2
parent416adc8711d16c5231693f19ca483dd3d59bef5d
sparse-checkout: check for dirty status

The index-merge performed by 'git sparse-checkout' will erase any staged
changes, which can lead to data loss. Prevent these attempts by requiring
a clean 'git status' output.

Helped-by: Szeder Gábor <szeder.dev@gmail.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/sparse-checkout.c
t/t1091-sparse-checkout-builtin.sh