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

Fix detection of git submodules #49

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

djhoese
Copy link

@djhoese djhoese commented Sep 22, 2020

Closes #48

This uses the "--show-superproject-working-tree" flag in the get_toplevel_path call to git to add an additional line of output if the current directory is a git submodule of another project (a super project). When provided along with the --show-toplevel flag and when in a git submodule you will get two lines of output. One for the git submodule root and one for the super project root (note: order of the flags in the command determine the order of the lines in the output). If it isn't a git submodule then there will only ever be one line of output.

@djhoese
Copy link
Author

djhoese commented Sep 22, 2020

So I'm trying to make this work for my own project and it turns out this won't work when we get to the ref filtering as the file_exists function uses git cat-file which doesn't seem to work properly with git submodules.

@djhoese
Copy link
Author

djhoese commented Sep 22, 2020

Ok even if I hack that to work (modifying file_exists) it still fails because the copy_tree function uses git_archive which doesn't support git submodules. Wow, I didn't think this was going to be this hard.

@BurningEnlightenment

This comment was marked as outdated.

@BurningEnlightenment BurningEnlightenment marked this as a duplicate and then as not a duplicate of #17 Oct 6, 2024
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.

Working with git submodules
2 participants