Fix #1407: Make 'kpt pkg get' use current directory when '.' is specified#4334
Open
ciaranjohnston wants to merge 3 commits intomainfrom
Open
Fix #1407: Make 'kpt pkg get' use current directory when '.' is specified#4334ciaranjohnston wants to merge 3 commits intomainfrom
ciaranjohnston wants to merge 3 commits intomainfrom
Conversation
✅ Deploy Preview for kptdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
mozesl-nokia
approved these changes
Dec 10, 2025
liamfallon
approved these changes
Jan 13, 2026
…fied When users explicitly pass '.' as the destination directory, kpt pkg get now places files directly in the current directory, matching the behavior of 'git clone' and 'kpt cfg set'. Changes: - Modified parse.GitParseArgs() to track if destination was explicitly provided - Updated getDest() to use current directory directly when explicitly specified - Modified get.Run() to allow using existing empty directories - Preserved default behavior: when no destination is provided, still creates a subdirectory with the package name Fixes #1407 Signed-off-by: Ciaran Johnston <ciaran.johnston@ericsson.com>
Signed-off-by: Ciaran Johnston <ciaran.johnston@ericsson.com>
…tions - Changed getDest() to check cleaned path (v) instead of originalV for '.' comparison - Updated tests to expect current directory when './' or '.' is explicitly passed - Fixed TestCmdMainBranch_execute to not pass './' explicitly - Fixed TestCmd_fail to use non-existent destination directory Signed-off-by: Ciaran Johnston <ciaran.johnston@ericsson.com>
b8ecd88 to
e2529dc
Compare
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.
When users explicitly pass '.' as the destination directory, kpt pkg get now places files directly in the current directory, matching the behavior of 'git clone' and 'kpt cfg set'.
Changes:
Fixes #1407