Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure files are marked readonly after unlocking by ID #2642

Merged
merged 2 commits into from
Oct 3, 2017

Conversation

technoweenie
Copy link
Contributor

Fixes #2640 by moving the file permission logic from UnlockFile() to UnlockFileById(). The path is taken from the lock property returned by the /unlock api endpoint.

$ GIT_CURL_VERBOSE=1 git lfs unlock --id=123
> POST /my-repo.git/info/lfs/locks/123/unlock HTTP/1.1
> Host: github.com
> Accept: application/vnd.git-lfs+json; charset=utf-8
> Authorization: Basic * * * * *
> Content-Length: 15
> Content-Type: application/vnd.git-lfs+json; charset=utf-8
> User-Agent: git-lfs/2.3.1 (GitHub; darwin amd64; go 1.9)
>
{"force":false}

< HTTP/1.1 200 OK
< Content-Length: 141
< Content-Type: application/vnd.git-lfs+json
< Date: Tue, 03 Oct 2017 17:11:25 GMT
< X-Frame-Options: DENY
< X-Github-Request-Id: FF7E:5D17:5AA5486:AB0C1BC:59D3C4BD
<
{"lock":{"id":"123","path":"my-file.zip","locked_at":"2017-10-03T17:11:09Z","unlocked_at":"2017-10-03T17:11:25.692648804Z"}}
Unlocked Lock 123

@technoweenie technoweenie merged commit 4fe2667 into master Oct 3, 2017
@technoweenie technoweenie deleted the fix-unlock-by-id branch October 3, 2017 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants