Title: Fix issue with directory glob ignore in subdirectories by roblg · Pull Request #4239 · libgit2/libgit2 · GitHub
Open Graph Title: Fix issue with directory glob ignore in subdirectories by roblg · Pull Request #4239 · libgit2/libgit2
X Title: Fix issue with directory glob ignore in subdirectories by roblg · Pull Request #4239 · libgit2/libgit2
Description: Observed issue: Git understands /*/ in a .gitignore file to mean "ignore all root-level directories, but include files". Published libgit2 has the same behavior except when the .gitignore file is in a subdirectory of the repository. I reproduced this behavior with tests master and 0.24.3. I added four new tests; three of them already work in master. The one that fails w/o my change is test_status_ignore__subdir_ignore_all_toplevel_dirs_include_files. The other tests in status::ignore illustrate that the issue was only occurring for .gitignore files in subdirectories, and only for directory matches. My proposed changed seems safe to me, because relpath is derived from path->path, which is in the original code, and it only affects the case where the match is looking for a directory and the path being looked at is a file. I also rolled a dev version of atom and linked in a version of this patch based on 0.24.3 and verified that the expected behavior (my root-level files show up!) is observed. Old and new tests pass, so how could it possibly be broken, amirite? 😀 But in all seriousness, I'm not at all familiar with this code, so if there's something else I can do, let me know. Thanks!
Open Graph Description: Observed issue: Git understands /*/ in a .gitignore file to mean "ignore all root-level directories, but include files". Published libgit2 has the same behavior except when the .gitignor...
X Description: Observed issue: Git understands /*/ in a .gitignore file to mean "ignore all root-level directories, but include files". Published libgit2 has the same behavior except when the ....
Opengraph URL: https://github.com/libgit2/libgit2/pull/4239
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:9040db15-8b22-9dbf-7c30-827220ea3e6d |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C1EC:2F6413:624F3E7:813C78D:6A5DC75A |
| html-safe-nonce | e483f36ad1424fb2f6ca2802ca802fec50fb911fb530c9735caf12465c2169d0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMUVDOjJGNjQxMzo2MjRGM0U3OjgxM0M3OEQ6NkE1REM3NUEiLCJ2aXNpdG9yX2lkIjoiNTc1Mzk3ODY5MTk0MTk0MzEzMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f39aac3c80856afe2cdc48e1cc5e3d5a963fe8bb4d700219032094b045f141ab |
| hovercard-subject-tag | pull_request:120495738 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/libgit2/libgit2/pull/4239/files |
| twitter:image | https://avatars.githubusercontent.com/u/777138?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/777138?s=400&v=4 |
| og:image:alt | Observed issue: Git understands /*/ in a .gitignore file to mean "ignore all root-level directories, but include files". Published libgit2 has the same behavior except when the .gitignor... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/libgit2/libgit2 git https://github.com/libgit2/libgit2.git |
| octolytics-dimension-user_id | 394745 |
| octolytics-dimension-user_login | libgit2 |
| octolytics-dimension-repository_id | 901662 |
| octolytics-dimension-repository_nwo | libgit2/libgit2 |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 901662 |
| octolytics-dimension-repository_network_root_nwo | libgit2/libgit2 |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width