[WIP] Fix bugs of parsing gitignore

This PR fixes some bugs of parsing gitignore.