()
| 70 | } |
| 71 | |
| 72 | func ExamplePlainClone_usernamePassword() { |
| 73 | // Tempdir to clone the repository |
| 74 | dir, err := os.MkdirTemp("", "clone-example") |
| 75 | if err != nil { |
| 76 | log.Fatal(err) |
| 77 | } |
| 78 | |
| 79 | defer os.RemoveAll(dir) // clean up |
| 80 | |
| 81 | // Clones the repository into the given dir, just as a normal git clone does |
| 82 | _, err = git.PlainClone(dir, false, &git.CloneOptions{ |
| 83 | URL: "https://github.com/git-fixtures/basic.git", |
| 84 | Auth: &http.BasicAuth{ |
| 85 | Username: "username", |
| 86 | Password: "password", |
| 87 | }, |
| 88 | }) |
| 89 | |
| 90 | if err != nil { |
| 91 | log.Fatal(err) |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | func ExamplePlainClone_accessToken() { |
| 96 | // Tempdir to clone the repository |
nothing calls this directly
no outgoing calls
no test coverage detected