Refspec returns the fully-qualified reference name (including remote), i.e., for a remote branch called 'my-feature' on remote 'origin', this function will return: refs/remotes/origin/my-feature
()
| 113 | // |
| 114 | // refs/remotes/origin/my-feature |
| 115 | func (r *Ref) Refspec() string { |
| 116 | if r == nil { |
| 117 | return "" |
| 118 | } |
| 119 | |
| 120 | prefix, ok := r.Type.Prefix() |
| 121 | if ok { |
| 122 | return fmt.Sprintf("%s/%s", prefix, r.Name) |
| 123 | } |
| 124 | |
| 125 | return r.Name |
| 126 | } |
| 127 | |
| 128 | // HasValidObjectIDLength returns true if `s` has a length that is a valid |
| 129 | // hexadecimal Git object ID length. |