You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 11, 2020. It is now read-only.
I am trying to figure out if the library supports the equivalent to "git ls-files 'pattern'" to get references to multiple files matching eg. a '*/foo' pattern (to find all files in a repository with a certain name).
However, it has to be a full file path, like "src/foo" and doesn't seem to provide a way to list "all files matching foo".
Is there another way to do this, or is this a feature request? (I suppose iterating through every file in the repository is an option but not really a feasible one for large repos)
The text was updated successfully, but these errors were encountered:
Note that References function will probably disappear or made private once we release go-git v4 as stable.
Currently this functionality is not provided out of the box, but you can easily implement it in a couple of ways. Once you get an object.Commit you can iterate its files with Files or retrieve the Tree to perform a custom walk. See the doc of the object package here: https://godoc.org/gopkg.in/src-d/go-git.v4/plumbing/object
I am trying to figure out if the library supports the equivalent to "git ls-files 'pattern'" to get references to multiple files matching eg. a '*/foo' pattern (to find all files in a repository with a certain name).
It looks like References can list paths:
https://godoc.org/gopkg.in/src-d/go-git.v4#References
However, it has to be a full file path, like "src/foo" and doesn't seem to provide a way to list "all files matching foo".
Is there another way to do this, or is this a feature request? (I suppose iterating through every file in the repository is an option but not really a feasible one for large repos)
The text was updated successfully, but these errors were encountered: