()
| 116 | } |
| 117 | |
| 118 | func ExampleRepository_References() { |
| 119 | r, _ := git.Clone(memory.NewStorage(), nil, &git.CloneOptions{ |
| 120 | URL: "https://github.com/git-fixtures/basic.git", |
| 121 | }) |
| 122 | |
| 123 | // simulating a git show-ref |
| 124 | refs, _ := r.References() |
| 125 | refs.ForEach(func(ref *plumbing.Reference) error { |
| 126 | if ref.Type() == plumbing.HashReference { |
| 127 | fmt.Println(ref) |
| 128 | } |
| 129 | |
| 130 | return nil |
| 131 | }) |
| 132 | |
| 133 | // Example Output: |
| 134 | // 6ecf0ef2c2dffb796033e5a02219af86ec6584e5 refs/remotes/origin/master |
| 135 | // e8d3ffab552895c19b9fcf7aa264d277cde33881 refs/remotes/origin/branch |
| 136 | // 6ecf0ef2c2dffb796033e5a02219af86ec6584e5 refs/heads/master |
| 137 | |
| 138 | } |
| 139 | |
| 140 | func ExampleRepository_CreateRemote() { |
| 141 | r, _ := git.Init(memory.NewStorage(), nil) |
nothing calls this directly
no test coverage detected