()
| 138 | } |
| 139 | |
| 140 | func ExampleRepository_CreateRemote() { |
| 141 | r, _ := git.Init(memory.NewStorage(), nil) |
| 142 | |
| 143 | // Add a new remote, with the default fetch refspec |
| 144 | _, err := r.CreateRemote(&config.RemoteConfig{ |
| 145 | Name: "example", |
| 146 | URLs: []string{"https://github.com/git-fixtures/basic.git"}, |
| 147 | }) |
| 148 | |
| 149 | if err != nil { |
| 150 | log.Fatal(err) |
| 151 | } |
| 152 | |
| 153 | list, err := r.Remotes() |
| 154 | if err != nil { |
| 155 | log.Fatal(err) |
| 156 | } |
| 157 | |
| 158 | for _, r := range list { |
| 159 | fmt.Println(r) |
| 160 | } |
| 161 | |
| 162 | // Example Output: |
| 163 | // example https://github.com/git-fixtures/basic.git (fetch) |
| 164 | // example https://github.com/git-fixtures/basic.git (push) |
| 165 | } |
nothing calls this directly
no test coverage detected