Build abs/rel paths and process one directory entry. */ Try to load a nested .gitignore from this directory. Returns owned pointer or NULL. */
| 659 | /* Build abs/rel paths and process one directory entry. */ |
| 660 | /* Try to load a nested .gitignore from this directory. Returns owned pointer or NULL. */ |
| 661 | static cbm_gitignore_t *try_load_nested_gitignore(const walk_frame_t *frame) { |
| 662 | if (frame->local_gi || frame->prefix[0] == '\0') { |
| 663 | return NULL; |
| 664 | } |
| 665 | char gi_path[CBM_SZ_4K]; |
| 666 | snprintf(gi_path, sizeof(gi_path), "%s/.gitignore", frame->dir); |
| 667 | struct stat gi_st; |
| 668 | if (wide_stat(gi_path, &gi_st) == 0 && S_ISREG(gi_st.st_mode)) { |
| 669 | return cbm_gitignore_load(gi_path); |
| 670 | } |
| 671 | return NULL; |
| 672 | } |
| 673 | |
| 674 | /* Push a subdirectory onto the walk stack, inheriting local gitignore context. */ |
| 675 | static void walk_push_subdir(walk_frame_t *stack, int *top, const char *abs_path, |
no test coverage detected