Skip to content
This repository was archived by the owner on Apr 12, 2019. It is now read-only.

Fix tree entry parsing #110

Merged
merged 3 commits into from
Feb 10, 2018
Merged

Fix tree entry parsing #110

merged 3 commits into from
Feb 10, 2018

Conversation

ethantkoenig
Copy link
Member

@ethantkoenig ethantkoenig commented Feb 9, 2018

Fixes the parsing of filenames with escaped characters, which did not previously handled escaped characters such as \n correctly. Also adds unit tests.

This PR also exposes the parsing functionality as public, so that it can be reused (see https://github.com/go-gitea/gitea/blob/a89592d4abfef01e68e3c53a3cdb3846b03abd2b/models/repo_indexer.go#L234)

tree.go Outdated
if err != nil {
return nil, err
}
for _, entry := range t.entries {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A second traversing is unnecessary.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a method named ParseEntries of tree is better?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lunny Done

@lunny lunny merged commit 827f97a into go-gitea:master Feb 10, 2018
@lafriks
Copy link
Member

lafriks commented Feb 10, 2018

Please update gitea dep

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants