Fix input git to correctly handle subdir argument (solve #884)
Previously, the subdir argument wa ignored by dagger input git. I've fix that behavior and add a test. Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
@@ -139,10 +139,16 @@ func (git gitInput) Compile(_ string, _ *State) (*compiler.Value, error) {
|
||||
ref = git.Ref
|
||||
}
|
||||
|
||||
dir := ""
|
||||
if git.Dir != "" {
|
||||
dir = fmt.Sprintf(`,{do:"subdir", dir:"%s"}`, git.Dir)
|
||||
}
|
||||
|
||||
return compiler.Compile("", fmt.Sprintf(
|
||||
`#up: [{do:"fetch-git", remote:"%s", ref:"%s"}]`,
|
||||
`#up: [{do:"fetch-git", remote:"%s", ref:"%s"}%s]`,
|
||||
git.Remote,
|
||||
ref,
|
||||
dir,
|
||||
))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user