#Go SDK Git Clone

1 messages · Page 1 of 1 (latest)

barren trout
#

Is it possible to include the .git directory in the repo tree from the dagger client git clone?

barren trout
#

I assume that KeepGitDir is defaulting to false

terse sonnet
#

It is possible. We should add that to the API!

stable warren
#

Verified that we're not inlcuding .git today.
@barren trout could you open an issue that has a little info on your use case? 🙏
Your reason for needing .git to be present.

package main

import (
    "context"
    "fmt"

    "dagger.io/dagger"
)

func main() {
    ctx := context.Background()
    client, _ := dagger.Connect(ctx)
    defer client.Close()

    dir := client.Git("https://github.com/dagger/dagger").Branch("main").Tree()
    ent, _ := dir.Entries(ctx)
    fmt.Println(ent)
}

output of go run

[.dockerignore .github .gitignore .golangci.yml .goreleaser.yml .markdownlint.yaml Dockerfile LICENSE NOTICE README.md RELEASING.md TESTING.md cmd codegen core demos docs engine examples go.mod go.sum internal magefile.go package.json project router sdk secret tracing tsconfig.json website yarn.lock]
barren trout
#

Sure thing

stable warren
#

As a workaround for now, you could use an Exec to git clone, but agree this should be in API.

barren trout
#

Thanks for the workaround. I will add it to the issue for the time being.

barren trout
barren trout
#

I'm taking a stab at making a pull request for this change. What is the recommended method for executing the sdk client gen? I only see the codegen lint in the magefile

terse sonnet
barren silo
terse sonnet