Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Allow for an access mechanism to be specified in the .lfsconfig file#1122

Merged
technoweenie merged 1 commit into
git-lfs:masterfrom
rjbell4:allowaccess
Apr 6, 2016
Merged

Allow for an access mechanism to be specified in the .lfsconfig file#1122
technoweenie merged 1 commit into
git-lfs:masterfrom
rjbell4:allowaccess

Conversation

@rjbell4

@rjbell4 rjbell4 commented Apr 4, 2016

Copy link
Copy Markdown
Contributor

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.

@technoweenie

Copy link
Copy Markdown
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_test

This is a failing test on master that should work with this PR.

@rjbell4

rjbell4 commented Apr 5, 2016

Copy link
Copy Markdown
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.

@technoweenie

Copy link
Copy Markdown
Contributor

Awesome, thanks 🤘

@technoweenie technoweenie merged commit 3671987 into git-lfs:master Apr 6, 2016
@rjbell4 rjbell4 deleted the allowaccess branch April 6, 2016 14:33
@technoweenie technoweenie mentioned this pull request Apr 6, 2016
17 tasks
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