Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

submodule: catch when submodule is not staged on update#4161

Merged
ethomson merged 1 commit intolibgit2:masterlibgit2/libgit2:masterfrom
pks-t:pks/submodule-index-fixpks-t/libgit2:pks/submodule-index-fixCopy head branch name to clipboard
Mar 15, 2017
Merged

submodule: catch when submodule is not staged on update#4161
ethomson merged 1 commit intolibgit2:masterlibgit2/libgit2:masterfrom
pks-t:pks/submodule-index-fixpks-t/libgit2:pks/submodule-index-fixCopy head branch name to clipboard

Conversation

@pks-t
Copy link
Member

@pks-t pks-t commented Mar 14, 2017

When calling git_submodule_update on a submodule, we have to retrieve
the ID of the submodule entry in the index. If the function is called on
a submodule which is only partly initialized, the submodule entry may
not be added to the index yet. This leads to an assert when trying to
look up the blob later on.

Fix the issue by checking if the index actually holds the submodule's
ID and erroring out if it does not.

The issue has been uncovered by #4149. Even though it was incorrect usage of the API, this should not result in an assert but in an error, instead.

When calling `git_submodule_update` on a submodule, we have to retrieve
the ID of the submodule entry in the index. If the function is called on
a submodule which is only partly initialized, the submodule entry may
not be added to the index yet. This leads to an assert when trying to
look up the blob later on.

Fix the issue by checking if the index actually holds the submodule's
ID and erroring out if it does not.
@ethomson ethomson merged commit 6dfb983 into libgit2:master Mar 15, 2017
@ethomson
Copy link
Member

Thanks! 😄

@pks-t pks-t deleted the pks/submodule-index-fix branch April 7, 2017 09:20
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.