locking: make API requests relative to repository, not root#1818
Merged
locking: make API requests relative to repository, not root#1818
Conversation
technoweenie
approved these changes
Jan 3, 2017
This was referenced Jan 5, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull-request brings in some API changes which fixes making locking API requests at the root of the remote, instead of relative to the current repository.
It is currently based off of
master, and should wait until #1815, #1816 & #1817 have been merged first. Once those three are merged intomaster, I'll rebase this PR off ofmaster, and then merge. After this is merged intomaster, I think the changes should be merged back intoapi-master. Another approach we could take is to target this atapi-master, to simplify some of the merging back and forth. I think it would be preferable to merge this intomasterfirst, if we cut a release off of master beforeapi-masterhas been finished.Here's a before and after:
And a summary of what changed:
func (*net/url.URL) ResolveReference), allow for relative path joining.AcceptandContent-Typeheader to all API requests made using the*api.Clienttype./repo.git/info/lfs/locksis a GET request{assert,refute}_server_lockhelpers have the information they need to make requests at the correct location.Before merging, I'd like to teach the gitserver how to store a per-repo cache of locks, instead of maintaining a global one.
/cc @git-lfs/core