Compute path relative to a nested .gitignore's directory. * "webapp/src/foo.js" with prefix "webapp" → "src/foo.js". */
| 652 | /* Compute path relative to a nested .gitignore's directory. |
| 653 | * "webapp/src/foo.js" with prefix "webapp" → "src/foo.js". */ |
| 654 | static const char *local_rel_path(const char *rel_path, const char *local_prefix) { |
| 655 | if (!local_prefix || local_prefix[0] == '\0') { |
| 656 | return rel_path; |
| 657 | } |
| 658 | size_t prefix_len = strlen(local_prefix); |
| 659 | if (strncmp(rel_path, local_prefix, prefix_len) == 0 && rel_path[prefix_len] == '/') { |
| 660 | return rel_path + prefix_len + SKIP_ONE; |
| 661 | } |
| 662 | return rel_path; |
| 663 | } |
| 664 | |
| 665 | /* One .gitignore on the path from the repository root down to a walk frame. |
| 666 | * Links form a root->leaf chain; every frame below the directory that owns a |
no outgoing calls
no test coverage detected