5 begin_test "default config"
8 reponame="default-config"
12 git remote add origin "$GITSERVER/$reponame"
13 git lfs env | tee env.log
14 grep "Endpoint=$GITSERVER/$reponame.git/info/lfs (auth=none)" env.log
16 git config --file=.gitconfig lfs.url http://gitconfig-file-ignored
17 git config --file=.lfsconfig lfs.url http://lfsconfig-file
18 git config --file=.lfsconfig lfs.http://lfsconfig-file.access lfsconfig
19 git lfs env | tee env.log
20 grep "Endpoint=http://lfsconfig-file (auth=lfsconfig)" env.log
22 git config --file=.lfsconfig --unset lfs.url
23 git config --file=.lfsconfig --unset lfs.http://lfsconfig-file.access
25 # new endpoint url from local git config
26 # access setting no longer applied
27 git config lfs.url http://local-lfsconfig
28 git lfs env | tee env.log
29 grep "Endpoint=http://local-lfsconfig (auth=none)" env.log
31 # add the access setting to lfsconfig
32 git config --file=.lfsconfig lfs.http://local-lfsconfig.access lfsconfig
33 git lfs env | tee env.log
34 grep "Endpoint=http://local-lfsconfig (auth=lfsconfig)" env.log
36 git config --file=.lfsconfig --unset lfs.http://local-lfsconfig.access
38 # add the access setting to git config
39 git config lfs.http://local-lfsconfig.access gitconfig
40 git lfs env | tee env.log
41 grep "Endpoint=http://local-lfsconfig (auth=gitconfig)" env.log
45 begin_test "extension config"
49 git config --global lfs.extension.env-test.clean "env-test-clean"
50 git config --global lfs.extension.env-test.smudge "env-test-smudge"
51 git config --global lfs.extension.env-test.priority 0
53 reponame="extension-config"
58 expected0="Extension: env-test
59 clean = env-test-clean
60 smudge = env-test-smudge
63 [ "$expected0" = "$(git lfs ext)" ]
65 # any git config takes precedence over .lfsconfig
66 git config --global --unset lfs.extension.env-test.priority
68 git config --file=.lfsconfig lfs.extension.env-test.clean "file-env-test-clean"
69 git config --file=.lfsconfig lfs.extension.env-test.smudge "file-env-test-smudge"
70 git config --file=.lfsconfig lfs.extension.env-test.priority 1
72 expected1="Extension: env-test
73 clean = env-test-clean
74 smudge = env-test-smudge
77 [ "$expected1" = "$(GIT_TRACE=5 git lfs ext)" ]
79 git config lfs.extension.env-test.clean "local-env-test-clean"
80 git config lfs.extension.env-test.smudge "local-env-test-smudge"
81 git config lfs.extension.env-test.priority 2
82 expected2="Extension: env-test
83 clean = local-env-test-clean
84 smudge = local-env-test-smudge
87 [ "$expected2" = "$(git lfs ext)" ]
91 begin_test "url alias config"
100 # When more than one insteadOf strings match a given URL, the longest match is used.
101 git config url."http://wrong-url/".insteadOf alias
102 git config url."http://actual-url/".insteadOf alias:
103 git config lfs.url alias:rest
104 git lfs env | tee env.log
105 grep "Endpoint=http://actual-url/rest (auth=none)" env.log
109 begin_test "ambiguous url alias"
113 mkdir url-alias-ambiguous
114 cd url-alias-ambiguous
118 git config url."http://actual-url/".insteadOf alias:
119 git config url."http://dupe-url".insteadOf alias:
120 git config lfs.url alias:rest
121 git config -l | grep url
123 git lfs env 2>&1 | tee env2.log
124 grep "WARNING: Multiple 'url.*.insteadof'" env2.log
128 begin_test "url alias must be prefix"
137 git config url."http://actual-url/".insteadOf alias:
138 git config lfs.url badalias:rest
139 git lfs env | tee env.log
140 grep "Endpoint=badalias:rest (auth=none)" env.log
144 begin_test "config: ignoring unsafe lfsconfig keys"
148 reponame="config-unsafe-lfsconfig-keys"
152 # Insert an 'unsafe' key into this repository's '.lfsconfig'.
153 git config --file=.lfsconfig core.askpass unsafe
155 git lfs env 2>&1 | tee status.log
157 grep "WARNING: These unsafe lfsconfig keys were ignored:" status.log
158 grep " core.askpass" status.log