Allow for an access mechanism to be specified in the .lfsconfig file#1122
Merged
Conversation
Contributor
|
Looks great, just needs a test :) diff --git a/test/test-config.sh b/test/test-config.sh
index b185396..b6438a8 100755
--- a/test/test-config.sh
+++ b/test/test-config.sh
@@ -15,12 +15,25 @@ begin_test "default config"
git config --file=.gitconfig lfs.url http://gitconfig-file-ignored
git config --file=.lfsconfig lfs.url http://lfsconfig-file
+ git config --file=.lfsconfig lfs.http://lfsconfig-file.access lfsconfig
git lfs env | tee env.log
- grep "Endpoint=http://lfsconfig-file (auth=none)" env.log
+ grep "Endpoint=http://lfsconfig-file (auth=lfsconfig)" env.log
+ # new endpoint url from local git config
+ # access setting no longer applied
git config lfs.url http://local-lfsconfig
git lfs env | tee env.log
grep "Endpoint=http://local-lfsconfig (auth=none)" env.log
+
+ # add the access setting to lfsconfig
+ git config --file=.lfsconfig lfs.http://local-lfsconfig.access lfsconfig
+ git lfs env | tee env.log
+ grep "Endpoint=http://local-lfsconfig (auth=lfsconfig)" env.log
+
+ # add the access setting to git config¡
+ git config lfs.http://local-lfsconfig.access config
+ git lfs env | tee env.log
+ grep "Endpoint=http://local-lfsconfig (auth=config)" env.log
)
end_testThis is a failing test on master that should work with this PR. |
Contributor
Author
|
Thanks for providing the example test. I added it (with just a minor change). I verified that it fails without my proposed change to config.go, and succeeds with the change. |
Contributor
|
Awesome, thanks 🤘 |
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.
I don't know if you want a change this simple, as I don't know the original intent, but as mentioned in issue #1121, I was hoping to describe the access of my LFS URL as "private" in the same .lfsconfig as where I define the URL itself. I think it makes the most sense to have this data be co-resident. However, git-lfs won't allow me to put this content in the .lfsconfig. This simple change allows me to define it there.