change remote.{name}.lfs config to remote.{name}.lfs_url

This commit is contained in:
Rick Olson 2015-03-22 13:15:20 -06:00
parent abd0fd107d
commit 5b2e9c39c5
3 changed files with 11 additions and 11 deletions

@ -52,7 +52,7 @@ can have different Git LFS endpoints for different remotes. Here is the list
of rules that Git LFS uses to determine a repository's Git LFS server: of rules that Git LFS uses to determine a repository's Git LFS server:
1. The `lfs.url` string. 1. The `lfs.url` string.
2. The `remote.{name}.lfs` string. 2. The `remote.{name}.lfs_url` string.
3. Append `/info/lfs` to the remote URL. Only works with HTTPS URLs. 3. Append `/info/lfs` to the remote URL. Only works with HTTPS URLs.
Here's a sample Git config file with the optional remote and Git LFS Here's a sample Git config file with the optional remote and Git LFS
@ -62,11 +62,11 @@ configuration options:
[core] [core]
repositoryformatversion = 0 repositoryformatversion = 0
[lfs] [lfs]
endpoint = "https://github.com/github/git-lfs/info/lfs" endpoint = "https://github.com/github/git-lfs.git/info/lfs"
[remote "origin"] [remote "origin"]
url = https://github.com/github/git-lfs url = https://github.com/github/git-lfs
fetch = +refs/heads/*:refs/remotes/origin/* fetch = +refs/heads/*:refs/remotes/origin/*
lfs = "https://github.com/github/git-lfs/info/lfs" lfs = "https://github.com/github/git-lfs.git/info/lfs"
``` ```
Git LFS uses `git credential` to fetch credentials for HTTPS requests. Setup Git LFS uses `git credential` to fetch credentials for HTTPS requests. Setup

@ -54,7 +54,7 @@ func (c *Configuration) RemoteEndpoint(remote string) string {
remote = defaultRemote remote = defaultRemote
} }
if url, ok := c.GitConfig("remote." + remote + ".lfs"); ok { if url, ok := c.GitConfig("remote." + remote + ".lfs_url"); ok {
return url return url
} }

@ -7,7 +7,7 @@ import (
func TestEndpointDefaultsToOrigin(t *testing.T) { func TestEndpointDefaultsToOrigin(t *testing.T) {
config := &Configuration{ config := &Configuration{
gitConfig: map[string]string{"remote.origin.lfs": "abc"}, gitConfig: map[string]string{"remote.origin.lfs_url": "abc"},
remotes: []string{}, remotes: []string{},
} }
@ -17,8 +17,8 @@ func TestEndpointDefaultsToOrigin(t *testing.T) {
func TestEndpointOverridesOrigin(t *testing.T) { func TestEndpointOverridesOrigin(t *testing.T) {
config := &Configuration{ config := &Configuration{
gitConfig: map[string]string{ gitConfig: map[string]string{
"lfs.url": "abc", "lfs.url": "abc",
"remote.origin.lfs": "def", "remote.origin.lfs_url": "def",
}, },
remotes: []string{}, remotes: []string{},
} }
@ -29,8 +29,8 @@ func TestEndpointOverridesOrigin(t *testing.T) {
func TestEndpointNoOverrideDefaultRemote(t *testing.T) { func TestEndpointNoOverrideDefaultRemote(t *testing.T) {
config := &Configuration{ config := &Configuration{
gitConfig: map[string]string{ gitConfig: map[string]string{
"remote.origin.lfs": "abc", "remote.origin.lfs_url": "abc",
"remote.other.lfs": "def", "remote.other.lfs_url": "def",
}, },
remotes: []string{}, remotes: []string{},
} }
@ -41,8 +41,8 @@ func TestEndpointNoOverrideDefaultRemote(t *testing.T) {
func TestEndpointUseAlternateRemote(t *testing.T) { func TestEndpointUseAlternateRemote(t *testing.T) {
config := &Configuration{ config := &Configuration{
gitConfig: map[string]string{ gitConfig: map[string]string{
"remote.origin.lfs": "abc", "remote.origin.lfs_url": "abc",
"remote.other.lfs": "def", "remote.other.lfs_url": "def",
}, },
remotes: []string{}, remotes: []string{},
} }