Conversation
|
/cc @mcuadros |
|
I'm not associated with this repository or this MR, but as a third-party, I can confirm that this patch improved my issue. With upstream go-git in a repo with a 350M folder that was listed in the .gitignore, worktree.Status() returned in ~ 1.6s at best. |
|
can you provide a test? |
There is no new functionality, so no need for a new unit test. |
| subps, err = ReadPatterns(fs, append(path, fi.Name())) | ||
| tempPath := make([]string, len(path)) | ||
| copy(tempPath, path) | ||
| subps, err = ReadPatterns(fs, append(tempPath, fi.Name())) |
There was a problem hiding this comment.
Think it would be cleaner to have the copy done by ParsePattern(), the object that takes ownership of the slice. Or in the readIgnoreFile func to share ownership. Here you would still get bugs if calling ReadPatterns incorrectly, e.g:
path := []string{"a", "b"}
ps, _ := ReadPatterns(fs, path)
path[1] = "change" // ps now corrupted|
@acumino a test is not only needed for new functionality, a test is useful for fixes like this for multiple reasons include:
|
|
/close |
Fixes: #500