[PATCH v6 1/4] read-cache: remove redundant extern declarations
- From
Tian Yuchen <cat@malon.dev>
- Date
- Jul 16, 2026, 08:49 UTC
- Message-ID
- <20260716084941.1101918-2-cat@malon.dev>
- In-Reply-To
- <20260716084941.1101918-1-cat@malon.dev>
The 'read-cache.c' file already includes 'environment.h', which provides the extern declarations for variables like 'trust_executable_bit' and 'has_symlinks'.
Remove the redundant extern declarations inside 'st_mode_from_ce()' to clean up the code.
Mentored-by: Christian Couder <christian.couder@gmail.com> Mentored-by: Ayush Chandekar <ayu.chandekar@gmail.com> Mentored-by: Olamide Caleb Bello <belkid98@gmail.com> Signed-off-by: Tian Yuchen <cat@malon.dev> --- read-cache.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/read-cache.c b/read-cache.c index 38a04b8de3..c44e4d128f 100644 --- a/read-cache.c +++ b/read-cache.c @@ -204,8 +204,6 @@ void fill_stat_cache_info(struct index_state *istate, struct cache_entry *ce, st static unsigned int st_mode_from_ce(const struct cache_entry *ce) { - extern int trust_executable_bit, has_symlinks; - switch (ce->ce_mode & S_IFMT) { case S_IFLNK: return has_symlinks ? S_IFLNK : (S_IFREG | 0644);
-- 2.43.0