Skip to content

git_index_add_frombuffer: only accept files/links#4529

Merged
ethomson merged 1 commit into
masterfrom
ethomson/index_add_requires_files
Feb 18, 2018
Merged

git_index_add_frombuffer: only accept files/links#4529
ethomson merged 1 commit into
masterfrom
ethomson/index_add_requires_files

Conversation

@ethomson
Copy link
Copy Markdown
Member

Ensure that the buffer given to git_index_add_frombuffer represents a regular blob, an executable blob, or a link. Explicitly reject commit entries (submodules) - it makes little sense to allow users to add a submodule from a string; there's no possible path to success.

Copy link
Copy Markdown
Member

@pks-t pks-t left a comment

Choose a reason for hiding this comment

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

Looks good to me. Only thing that stood out that you were testing all file modes except GIT_FILEMODE_LINK in the new test. Don't know if it's valuable to explicitly test that, as well.

Ensure that the buffer given to `git_index_add_frombuffer` represents a
regular blob, an executable blob, or a link.  Explicitly reject commit
entries (submodules) - it makes little sense to allow users to add a
submodule from a string; there's no possible path to success.
@ethomson ethomson force-pushed the ethomson/index_add_requires_files branch from 8c485b8 to 5f774db Compare February 18, 2018 10:08
@ethomson
Copy link
Copy Markdown
Member Author

It seems only minimally valuable, but it's also very easy, so I went ahead and added a test. Thanks, @pks-t.

@ethomson ethomson merged commit f1ad004 into master Feb 18, 2018
@ethomson ethomson deleted the ethomson/index_add_requires_files branch October 26, 2018 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants