(remote string, lockReq *lockRequest)
| 141 | } |
| 142 | |
| 143 | func (c *sshLockClient) Lock(remote string, lockReq *lockRequest) (*lockResponse, int, error) { |
| 144 | args := make([]string, 0, 3) |
| 145 | args = append(args, fmt.Sprintf("path=%s", lockReq.Path)) |
| 146 | if lockReq.Ref != nil { |
| 147 | args = append(args, fmt.Sprintf("refname=%s", lockReq.Ref.Name)) |
| 148 | } |
| 149 | conn, err := c.connection() |
| 150 | if err != nil { |
| 151 | return nil, 0, err |
| 152 | } |
| 153 | conn.Lock() |
| 154 | defer conn.Unlock() |
| 155 | err = conn.SendMessage("lock", args) |
| 156 | if err != nil { |
| 157 | return nil, 0, err |
| 158 | } |
| 159 | status, args, lines, err := conn.ReadStatusWithLines() |
| 160 | if err != nil { |
| 161 | return nil, status, err |
| 162 | |
| 163 | } |
| 164 | var lock lockResponse |
| 165 | lock.Lock, lock.Message, err = c.parseLockResponse(status, args, lines) |
| 166 | return &lock, status, err |
| 167 | } |
| 168 | |
| 169 | func (c *sshLockClient) Unlock(ref *git.Ref, remote, id string, force bool) (*unlockResponse, int, error) { |
| 170 | args := make([]string, 0, 3) |
nothing calls this directly
no test coverage detected