Build abs/rel paths and process one directory entry. */ Try to load a nested .gitignore from this directory. Returns owned pointer or NULL. */
| 816 | /* Build abs/rel paths and process one directory entry. */ |
| 817 | /* Try to load a nested .gitignore from this directory. Returns owned pointer or NULL. */ |
| 818 | static cbm_gitignore_t *try_load_nested_gitignore(const walk_frame_t *frame) { |
| 819 | if (frame->local_gi || frame->prefix[0] == '\0') { |
| 820 | return NULL; |
| 821 | } |
| 822 | char gi_path[CBM_SZ_4K]; |
| 823 | snprintf(gi_path, sizeof(gi_path), "%s/.gitignore", frame->dir); |
| 824 | struct stat gi_st; |
| 825 | if (wide_stat(gi_path, &gi_st) == 0 && S_ISREG(gi_st.st_mode)) { |
| 826 | return cbm_gitignore_load(gi_path); |
| 827 | } |
| 828 | return NULL; |
| 829 | } |
| 830 | |
| 831 | /* Push a subdirectory onto the walk stack, inheriting local gitignore |
| 832 | * context. Grows the stack geometrically; the caller's `parent` must not |
no test coverage detected