Src returns the src side.
()
| 66 | |
| 67 | // Src returns the src side. |
| 68 | func (s RefSpec) Src() string { |
| 69 | spec := string(s) |
| 70 | |
| 71 | var start int |
| 72 | if s.IsForceUpdate() { |
| 73 | start = 1 |
| 74 | } else { |
| 75 | start = 0 |
| 76 | } |
| 77 | |
| 78 | end := strings.Index(spec, refSpecSeparator) |
| 79 | return spec[start:end] |
| 80 | } |
| 81 | |
| 82 | // Match match the given plumbing.ReferenceName against the source. |
| 83 | func (s RefSpec) Match(n plumbing.ReferenceName) bool { |