Skip to content

Submodules with bare repo#4305

Merged
ethomson merged 3 commits intolibgit2:masterfrom
pks-t:pks/submodule-with-bare-repo
Aug 25, 2017
Merged

Submodules with bare repo#4305
ethomson merged 3 commits intolibgit2:masterfrom
pks-t:pks/submodule-with-bare-repo

Conversation

@pks-t
Copy link
Copy Markdown
Member

@pks-t pks-t commented Jul 10, 2017

Fixes to some small issues with our submodule tests as well as explicit error returns when trying to access submodules in a bare repository. Related to #4068, even though the issue does not seem to occur anymore

pks-t added 3 commits August 25, 2017 18:05
The testcase "submodule::lookup::cached" was declared with a single
underscore separating the test suide and test name, only. As the clar
parser only catches tests with two underscores, it was never executed.
Add in the second underscore to actually have it detected and executed.
While it is technically possible to look up submodules inside of a
bare repository by reading the submodule configuration of a specific
commit, we do not offer this functionality right now. As such, calling
both `git_submodule_lookup` and `git_submodule_foreach` should error out
early when these functions encounter a bare repository. While
`git_submodule_lookup` already does return an error due to not being
able to parse the configuration, `git_submodule_foreach` simply returns
success and never invokes the callback function.

Fix the issue by having both functions check whether the repository is
bare and returning an error in that case.
@pks-t pks-t force-pushed the pks/submodule-with-bare-repo branch from 04d97ed to 477b3e0 Compare August 25, 2017 16:15
@pks-t
Copy link
Copy Markdown
Member Author

pks-t commented Aug 25, 2017

Ugh. The added bare repository contained an empty 'refs' directory due to all references being packed info the packed-refs file. As git doesn't store empty directories, it is missing in our repository, and git only regards a directory as a repository if it also contains a 'refs' directory. Should be fixed now.

@ethomson ethomson merged commit 4b000fc into libgit2:master Aug 25, 2017
@pks-t pks-t deleted the pks/submodule-with-bare-repo branch September 15, 2017 06:00
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