fix(terragrunt): strip double slash path separator from git URLs#7358
Merged
olblak merged 1 commit intoupdatecli:mainfrom Jan 1, 2026
Merged
Conversation
Terragrunt uses '//' as a path separator for subdirectories in module sources (e.g., git::https://github.com/org/repo//subdir?ref=v1.0.0). When Updatecli generates git SCM configurations, it was including this '//' in the repository URL, causing git clone failures with 'repository not found' errors. This fix strips the '//' path separator and everything after it from the baseUrl when parsing git sources, ensuring clean repository URLs for cloning. Added test cases: - git URL with trailing '//' - git URL with '//subdir' path Fixes: Repository not found errors for all git-based module sources
olblak
approved these changes
Jan 1, 2026
Member
olblak
left a comment
There was a problem hiding this comment.
Thanks for the pull request with the tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Terragrunt autodiscovery was failing with "repository not found" errors for all git-based module sources. The generated git URLs contained Terragrunt's
//path separator, creating invalid repository URLs like:Root Cause
Terragrunt uses
//as a special path separator for subdirectories in module sources:When Updatecli parsed these sources, it included the
//in thebaseUrl, which was then used directly in git clone operations, causing failures.See https://community.gruntwork.io/t/relative-paths-in-terragrunt-modules/144
Solution
Strip the
//path separator and everything after it from thebaseUrlwhen parsing git sources. The full source (including//subdir) is preserved inrawSourceandevaluatedSourcefor other uses, but thebaseUrlnow contains only the clean repository URL needed for cloning.Testing
Added test cases covering:
////subdirpathAll tests pass.
Impact
Fixes repository cloning for all git-based Terragrunt modules during autodiscovery.