Skip to content

Commit 4414358

Browse files
derrickstoleegitster
authored andcommitted
sparse-checkout: use extern for global variables
When the core.sparseCheckoutCone config setting was added in 879321e ("sparse-checkout: add 'cone' mode" 2019-11-21), the variables storing the config values for core.sparseCheckout and core.sparseCheckoutCone were rearranged in cache.h, but in doing so the "extern" keyword was dropped. While we are tending to drop the "extern" keyword for function declarations, it is still necessary for global variables used across multiple *.c files. The impact of not having the extern keyword may be unpredictable. Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 761e3d2 commit 4414358

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cache.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -925,8 +925,8 @@ extern int protect_hfs;
925925
extern int protect_ntfs;
926926
extern const char *core_fsmonitor;
927927

928-
int core_apply_sparse_checkout;
929-
int core_sparse_checkout_cone;
928+
extern int core_apply_sparse_checkout;
929+
extern int core_sparse_checkout_cone;
930930

931931
/*
932932
* Include broken refs in all ref iterations, which will

0 commit comments

Comments
 (0)