Skip to content

Conversation

@cwlbraa
Copy link
Contributor

@cwlbraa cwlbraa commented Jul 15, 2025

fixes #161

needs some cleanup still, but this makes container-use work for dagger.io.

it creates a kind of weird in-between state inside the container where .gitmodules exists but .git does not, but it's enough to unblock.

fixes #161

Creating integration test for Git submodule support with comprehensive test cases

Fixing the unused import issue in the submodule test

Updated the test to allow file protocol for git submodules in tests

Implementing submodule support by adding initializeSubmodules function and calling it in initializeWorktree and propagateToWorktree

Adding protocol.file.allow=always to the WithRepository git config setup

Setting the global git config for protocol.file.allow in the test setup

Modified test to use relative paths within the same repository for submodules instead of external file URLs

Simplified test to manually create submodule structure instead of using git submodule commands, focusing on testing the core functionality

Removing unused ctx variable

Adding back the missing repository import

Formatting code to ensure consistent style

Implementing the templating approach for submodule .git files - initialize once in worktree, template back during export

Creating comprehensive user-focused tests that test real workflows with submodules, not implementation details

Removing the unused filepath import

Modifying the Create method to use the worktree directory directly instead of going through Git operations that might try to handle submodules

Restoring the original Create method - the issue is that Dagger's AsGit operations try to handle submodules and fail with file:// URLs

Creating realistic submodule tests that avoid the file:// URL issue by using manual structure and optional real HTTPS submodules

Removing the unused os import

Formatting the code to ensure consistent style
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.

[Bug]: Does not work with git submodules

1 participant