]> git.ipfire.org Git - thirdparty/git.git/commitdiff
read-cache: remove redundant extern declarations
authorTian Yuchen <cat@malon.dev>
Mon, 20 Jul 2026 10:53:32 +0000 (18:53 +0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Jul 2026 14:37:05 +0000 (07:37 -0700)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c

index 21829102ae275e124eb7b94550bc7ccf16993bac..1ced8c630ef637340f3063ae06bd2aa1f0d894bf 100644 (file)
@@ -205,8 +205,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);