What did you do before the bug happened? (Steps to reproduce your issue) This was ran: git clone https://github.com/Calbabreaker/piano --sparse cd piano git sparse-checkout add any_text git checkout deploy-frontend git sparse-checkout init --cone git sparse-checkout add any_text Basically clone any repository with --sparse, add anything to sparse-checkout list then checkout to another branch, init the sparse-checkout with --cone and add anything to it again. What did you expect to happen? (Expected behavior) Nothing at all except for the sparse-checkout list to be updated. What happened instead? (Actual behavior) A massive memory leak using all the RAM with one of the cpu cores being at 100% usage. [System Info] git version: git version 2.33.0 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 5.10.63-1-MANJARO #1 SMP PREEMPT Wed Sep 8 14:13:59 UTC 2021 x86_64 compiler info: gnuc: 11.1 libc info: glibc: 2.33 $SHELL (typically, interactive shell): /usr/bin/zsh