Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git merge with allow_bare option failed to reset workdir in the absorbed repo #707

Closed
shijinglu opened this issue May 22, 2019 · 0 comments

Comments

@shijinglu
Copy link
Collaborator

If a submodule is opened during merge, we the absorbed repo have valid workree:

$ cat $(git meta root)/.git/modules/foo/bar/config
[core]
<...>
     workdir = ../../../foo/bar

However, this is not always true in git-meta. There are occasions workdir is set to null even though it should not be. aka:

$ cat $(git meta root)/.git/modules/foo/bar/config
[core]
<...>
     workdir = null

The reasons is that, if the ALLOW_BARE option is enabled for normal merge, git meta will first try to merge the submodule inside the absorbed repo and treat it as a bare repo. And if there are any merge conflicts, git meta will then re open the subrepo. If a subrepo was first created as the bare repo, and then opened fully, git-meta won't reset the workdir and this leads to an empty submodule under foo/bar.

shijinglu added a commit to shijinglu/git-meta that referenced this issue Jun 5, 2019
…opened in bare mode then open with normal mode
novalis added a commit that referenced this issue Jun 10, 2019
fix #707: failed to set workdir correctly if submodule first opened i…
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

No branches or pull requests

1 participant