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
When the Match logic tries to resolve a relative path from 2 paths (eg. basepath, fullpath), it simply tries to obtain the path after the length of the basepath in fullpath, i.e.
However, this would fail when the your basepath was /. Also, there is already a function which finds out the relative path, i.e. path.filepath.Rel, why not simply use that?
_rel, err:=filepath.Rel(i._base, path)
Note: The / being the repository path is a case when I am trying to find out all the files in the file-system which satisfy a certain gitignore.
The text was updated successfully, but these errors were encountered:
go-gitignore/gitignore.go
Lines 250 to 252 in ae8ad1d
When the Match logic tries to resolve a relative path from 2 paths (eg.
basepath, fullpath
), it simply tries to obtain the path after the length of the basepath in fullpath, i.e.However, this would fail when the your basepath was
/
. Also, there is already a function which finds out the relative path, i.e.path.filepath.Rel
, why not simply use that?Note: The
/
being the repository path is a case when I am trying to find out all the files in the file-system which satisfy a certain gitignore.The text was updated successfully, but these errors were encountered: