stop sending committer when creating locks
This commit is contained in:
parent
e7de4391c0
commit
799439bb7b
@ -33,12 +33,6 @@ The client sends the following to create a lock by sending a `POST` to `/locks`
|
||||
|
||||
* `path` - String path name of the file that is locked. This should be
|
||||
relative to the root of the repository working directory.
|
||||
* `committer` - The optional values of `user.name` and `user.email` from the
|
||||
git config.
|
||||
|
||||
Lock services are not required to use or store the committer details, since most
|
||||
lock services should already be able to identify the committer according to
|
||||
their credentials. The `committer` values are used for display purposes only.
|
||||
|
||||
```js
|
||||
// POST https://lfs-server.com/locks
|
||||
@ -47,10 +41,6 @@ their credentials. The `committer` values are used for display purposes only.
|
||||
// Authorization: Basic ...
|
||||
{
|
||||
"path": "foo/bar.zip",
|
||||
"committer": {
|
||||
"name": "Jane Doe",
|
||||
"email": "janedoe@email.com"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -17,8 +17,6 @@ type lockClient struct {
|
||||
type lockRequest struct {
|
||||
// Path is the path that the client would like to obtain a lock against.
|
||||
Path string `json:"path"`
|
||||
// Committer is the individual that wishes to obtain the lock.
|
||||
Committer *Committer `json:"committer"`
|
||||
}
|
||||
|
||||
// LockResponse encapsulates the information sent over the API in response to
|
||||
|
@ -21,7 +21,7 @@ func TestAPILock(t *testing.T) {
|
||||
assert.Equal(t, "POST", r.Method)
|
||||
assert.Equal(t, lfsapi.MediaType, r.Header.Get("Accept"))
|
||||
assert.Equal(t, lfsapi.MediaType, r.Header.Get("Content-Type"))
|
||||
assert.Equal(t, "35", r.Header.Get("Content-Length"))
|
||||
assert.Equal(t, "18", r.Header.Get("Content-Length"))
|
||||
|
||||
lockReq := &lockRequest{}
|
||||
err := json.NewDecoder(r.Body).Decode(lockReq)
|
||||
|
@ -88,12 +88,7 @@ func (c *Client) Close() error {
|
||||
// path must be relative to the root of the repository
|
||||
// Returns the lock id if successful, or an error
|
||||
func (c *Client) LockFile(path string) (Lock, error) {
|
||||
lockReq := &lockRequest{
|
||||
Path: path,
|
||||
Committer: NewCommitter(c.client.CurrentUser()),
|
||||
}
|
||||
|
||||
lockRes, _, err := c.client.Lock(c.Remote, lockReq)
|
||||
lockRes, _, err := c.client.Lock(c.Remote, &lockRequest{Path: path})
|
||||
if err != nil {
|
||||
return Lock{}, errors.Wrap(err, "api")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user