()
| 93 | } |
| 94 | |
| 95 | func ExamplePlainClone_accessToken() { |
| 96 | // Tempdir to clone the repository |
| 97 | dir, err := os.MkdirTemp("", "clone-example") |
| 98 | if err != nil { |
| 99 | log.Fatal(err) |
| 100 | } |
| 101 | |
| 102 | defer os.RemoveAll(dir) // clean up |
| 103 | |
| 104 | // Clones the repository into the given dir, just as a normal git clone does |
| 105 | _, err = git.PlainClone(dir, false, &git.CloneOptions{ |
| 106 | URL: "https://github.com/git-fixtures/basic.git", |
| 107 | Auth: &http.BasicAuth{ |
| 108 | Username: "abc123", // anything except an empty string |
| 109 | Password: "github_access_token", |
| 110 | }, |
| 111 | }) |
| 112 | |
| 113 | if err != nil { |
| 114 | log.Fatal(err) |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | func ExampleRepository_References() { |
| 119 | r, _ := git.Clone(memory.NewStorage(), nil, &git.CloneOptions{ |
nothing calls this directly
no outgoing calls
no test coverage detected