sparse-checkout: use extern for global variables