Skip to content

Commit 7b479cc

Browse files
authored
Merge pull request git-lfs#3928 from git-lfs/release-next
release: v2.9.1
2 parents 8ab05aa + 0539e1e commit 7b479cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+10628
-2747
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@master
1313
- run: script/cibuild
14+
- run: make release
15+
- run: mkdir -p bin/assets
16+
- run: find bin/releases -name "*$(uname -s | tr A-Z a-z)*" | xargs -I{} cp {} bin/assets
17+
- uses: actions/upload-artifact@v1
18+
with:
19+
name: ${{ matrix.os }}
20+
path: bin/assets
1421
build-windows:
1522
name: Build on Windows
1623
runs-on: windows-latest
@@ -19,7 +26,6 @@ jobs:
1926
- run: mkdir -p "$HOME/go/bin"
2027
shell: bash
2128
- run: set GOPATH=%HOME%\go
22-
- run: set PATH=%GOPATH%\bin;%PATH%
2329
- run: cinst InnoSetup -y
2430
- run: cinst strawberryperl -y
2531
- run: choco uninstall git.install -y --force
@@ -36,6 +42,14 @@ jobs:
3642
shell: bash
3743
- run: mv bin\git-lfs.exe git-lfs-x64.exe
3844
- run: iscc script\windows-installer\inno-setup-git-lfs-installer.iss
45+
- run: mkdir -p bin/assets
46+
shell: bash
47+
- run: mv *.exe bin/assets
48+
shell: bash
49+
- uses: actions/upload-artifact@v1
50+
with:
51+
name: windows-latest
52+
path: bin/assets
3953
build-latest:
4054
name: Build with latest Git
4155
strategy:

.github/workflows/release.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ jobs:
1313
- run: mkdir -p "$HOME/go/bin"
1414
shell: bash
1515
- run: set GOPATH=%HOME%\go
16-
- run: set PATH=%GOPATH%\bin;%PATH%
1716
- run: cinst InnoSetup -y
1817
- run: cinst strawberryperl -y
1918
- run: cinst zip -y
@@ -32,10 +31,6 @@ jobs:
3231
shell: bash
3332
- run: PATH="$HOME/go/bin:$PATH" make bin/releases/git-lfs-windows-386-$(git describe).zip
3433
shell: bash
35-
- run: echo "$PATH"
36-
shell: bash
37-
- run: find "/c/Program Files (x86)/Windows Kits/10/bin/x86"
38-
shell: bash
3934
- run: PATH="$HOME/go/bin:/c/Program Files (x86)/Windows Kits/10/bin/x86:$PATH" CERT_FILE="$HOME/cert.pfx" make release-windows
4035
shell: bash
4136
env:
@@ -68,6 +63,7 @@ jobs:
6863
steps:
6964
- uses: actions/checkout@master
7065
- uses: actions/setup-ruby@v1
66+
- run: gem install packagecloud-ruby
7167
- run: git clone https://github.com/git-lfs/build-dockers.git "$HOME/build-dockers"
7268
- run: (cd "$HOME/build-dockers" && ./build_dockers.bsh)
7369
- run: DOCKER_AUTOPULL=0 ./docker/run_dockers.bsh

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
# Git LFS Changelog
22

3+
## 2.9.1 (25 November 2019)
4+
5+
This release fixes a few regressions, such as the ability to use HTTP/1.1 when
6+
required, addresses a race condition, and switches the cookie jar parser to
7+
something that's easier for distributions to package.
8+
9+
We would like to extend a special thanks to the following open-source
10+
contributors:
11+
12+
* @nataliechen1 for fixing a data race
13+
* @ssgelm for writing and updating the code to use a new cookie jar parser
14+
15+
### Features
16+
17+
* Allow specifying HTTP version to use #3887 (@bk2204)
18+
19+
### Bugs
20+
21+
* synchronize access to netrcCredentialHelper.skip #3896 (@nataliechen1)
22+
* Fix several causes of CI problems #3878 (@bk2204)
23+
* Miscellaneous release fixes #3866 (@bk2204)
24+
25+
### Misc
26+
27+
* Build artifacts during CI for easier testing #3892 (@bk2204)
28+
* Use different parser for cookiejar files #3886 (@ssgelm)
29+
330
## 2.9.0 (17 October 2019)
431

532
This release adds support for DragonFly BSD, adds a new `git lfs dedup` command

config/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var (
1313
)
1414

1515
const (
16-
Version = "2.9.0"
16+
Version = "2.9.1"
1717
)
1818

1919
func init() {

creds/netrc.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"os"
66
"path/filepath"
77
"strings"
8+
"sync"
89

910
"github.com/git-lfs/git-lfs/config"
1011
"github.com/git-lfs/go-netrc/netrc"
@@ -39,6 +40,7 @@ func (f *noFinder) FindMachine(host string) *netrc.Machine {
3940
// NetrcCredentialHelper retrieves credentials from a .netrc file
4041
type netrcCredentialHelper struct {
4142
netrcFinder NetrcFinder
43+
mu sync.Mutex
4244
skip map[string]bool
4345
}
4446

@@ -65,11 +67,11 @@ func (c *netrcCredentialHelper) Fill(what Creds) (Creds, error) {
6567
if err != nil {
6668
return nil, credHelperNoOp
6769
}
68-
70+
c.mu.Lock()
71+
defer c.mu.Unlock()
6972
if c.skip[host] {
7073
return nil, credHelperNoOp
7174
}
72-
7375
if machine := c.netrcFinder.FindMachine(host); machine != nil {
7476
creds := make(Creds)
7577
creds["username"] = machine.Login
@@ -108,7 +110,9 @@ func (c *netrcCredentialHelper) Approve(what Creds) error {
108110
}
109111
tracerx.Printf("netrc: git credential approve (%q, %q, %q)",
110112
what["protocol"], what["host"], what["path"])
113+
c.mu.Lock()
111114
c.skip[host] = false
115+
c.mu.Unlock()
112116
return nil
113117
}
114118
return credHelperNoOp
@@ -123,7 +127,9 @@ func (c *netrcCredentialHelper) Reject(what Creds) error {
123127

124128
tracerx.Printf("netrc: git credential reject (%q, %q, %q)",
125129
what["protocol"], what["host"], what["path"])
130+
c.mu.Lock()
126131
c.skip[host] = true
132+
c.mu.Unlock()
127133
return nil
128134
}
129135
return credHelperNoOp

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
git-lfs (2.9.1) stable; urgency=low
2+
3+
* New upstream version
4+
5+
-- brian m. carlson <[email protected]> Mon, 25 Nov 2019 14:29:00 -0000
6+
17
git-lfs (2.9.0) stable; urgency=low
28

39
* New upstream version

go.mod

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,23 @@ module github.com/git-lfs/git-lfs
22

33
require (
44
github.com/alexbrainman/sspi v0.0.0-20180125232955-4729b3d4d858
5-
github.com/fsnotify/fsnotify v1.4.7 // indirect
65
github.com/git-lfs/gitobj v1.4.1
76
github.com/git-lfs/go-netrc v0.0.0-20180525200031-e0e9ca483a18
87
github.com/git-lfs/go-ntlm v0.0.0-20190401175752-c5056e7fa066
98
github.com/git-lfs/wildmatch v1.0.4
10-
github.com/google/slothfs v0.0.0-20190417171004-6b42407d9230
119
github.com/inconshreveable/mousetrap v1.0.0 // indirect
1210
github.com/mattn/go-isatty v0.0.4
1311
github.com/olekukonko/ts v0.0.0-20171002115256-78ecb04241c0
1412
github.com/pkg/errors v0.0.0-20170505043639-c605e284fe17
1513
github.com/rubyist/tracerx v0.0.0-20170927163412-787959303086
1614
github.com/spf13/cobra v0.0.3
1715
github.com/spf13/pflag v1.0.3 // indirect
16+
github.com/ssgelm/cookiejarparser v1.0.1
1817
github.com/stretchr/testify v1.2.2
1918
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
2019
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
2120
github.com/xeipuuv/gojsonschema v0.0.0-20170210233622-6b67b3fab74d
22-
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7
21+
golang.org/x/net v0.0.0-20191027093000-83d349e8ac1a
2322
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4
2423
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a
2524
)

go.sum

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ github.com/alexbrainman/sspi v0.0.0-20180125232955-4729b3d4d858 h1:OZQyEhf4Bviyd
22
github.com/alexbrainman/sspi v0.0.0-20180125232955-4729b3d4d858/go.mod h1:976q2ETgjT2snVCf2ZaBnyBbVoPERGjUz+0sofzEfro=
33
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
44
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5-
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
6-
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
75
github.com/git-lfs/gitobj v1.4.1 h1:6nH5d1QP7GJjZfBqaBXpS7mDzT4plXQLqUjPbcbtRpw=
86
github.com/git-lfs/gitobj v1.4.1/go.mod h1:B+djgKTnUoJHbg4uDvnC/+6xPcfEJNFbZd/YunEJRtA=
97
github.com/git-lfs/go-netrc v0.0.0-20180525200031-e0e9ca483a18 h1:7Th0eBA4rT8WJNiM1vppjaIv9W5WJinhpbCJvRJxloI=
@@ -12,8 +10,6 @@ github.com/git-lfs/go-ntlm v0.0.0-20190401175752-c5056e7fa066 h1:f5UyyCnv3o2EHy+
1210
github.com/git-lfs/go-ntlm v0.0.0-20190401175752-c5056e7fa066/go.mod h1:YnCP1lAyul0ITv9nT/OqXseZmGeaqvMVa2uvl8ssQvE=
1311
github.com/git-lfs/wildmatch v1.0.4 h1:Mj6LPnNZ6QSHLAAPDCH596pu6A/Z1xVm2Vk0+s3CtkY=
1412
github.com/git-lfs/wildmatch v1.0.4/go.mod h1:SdHAGnApDpnFYQ0vAxbniWR0sn7yLJ3QXo9RRfhn2ew=
15-
github.com/google/slothfs v0.0.0-20190417171004-6b42407d9230 h1:iBLrJ79cF90CZmpskySqhPvzrWr9njBYEsOZubXLZlc=
16-
github.com/google/slothfs v0.0.0-20190417171004-6b42407d9230/go.mod h1:kzvK/MFjZSNdFgc1tCZML3E1nVvnB4/npSKEuvMoECU=
1713
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
1814
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
1915
github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs=
@@ -30,6 +26,8 @@ github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8=
3026
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
3127
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
3228
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
29+
github.com/ssgelm/cookiejarparser v1.0.1 h1:cRdXauUbOTFzTPJFaeiWbHnQ+tRGlpKKzvIK9PUekE4=
30+
github.com/ssgelm/cookiejarparser v1.0.1/go.mod h1:DUfC0mpjIzlDN7DzKjXpHj0qMI5m9VrZuz3wSlI+OEI=
3331
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
3432
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
3533
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
@@ -39,8 +37,8 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:
3937
github.com/xeipuuv/gojsonschema v0.0.0-20170210233622-6b67b3fab74d h1:BJPiQVOMMtJsJIkrF4T6K3RKbzqr7rkaybMk33dlGUo=
4038
github.com/xeipuuv/gojsonschema v0.0.0-20170210233622-6b67b3fab74d/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs=
4139
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
42-
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 h1:fHDIZ2oxGnUZRN6WgWFCbYBjH9uqVPRCUVUDhs0wnbA=
43-
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
40+
golang.org/x/net v0.0.0-20191027093000-83d349e8ac1a h1:Yu34BogBivvmu7SAzHHaB9nZWH5D1C+z3F1jyIaYZSQ=
41+
golang.org/x/net v0.0.0-20191027093000-83d349e8ac1a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
4442
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw=
4543
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
4644
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=

lfsapi/auth.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ func (c *Client) doWithCreds(req *http.Request, credWrapper creds.CredentialHelp
9393

9494
req.Header.Set("User-Agent", lfshttp.UserAgent)
9595

96-
redirectedReq, res, err := c.client.DoWithRedirect(c.client.HttpClient(req.Host), req, "", via)
96+
client, err := c.client.HttpClient(req.URL)
97+
if err != nil {
98+
return nil, err
99+
}
100+
101+
redirectedReq, res, err := c.client.DoWithRedirect(client, req, "", via)
97102
if err != nil || res != nil {
98103
return res, err
99104
}

lfshttp/certs_test.go

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55
"io/ioutil"
66
"net/http"
7+
"net/url"
78
"os"
89
"path/filepath"
910
"testing"
@@ -48,6 +49,12 @@ var sslCAInfoMatchedHostTests = []struct {
4849
{"wronghost.com", false},
4950
}
5051

52+
func clientForHost(c *Client, host string) *http.Client {
53+
u, _ := url.Parse(fmt.Sprintf("https://%v", host))
54+
client, _ := c.HttpClient(u)
55+
return client
56+
}
57+
5158
func TestCertFromSSLCAInfoConfig(t *testing.T) {
5259
tempfile, err := ioutil.TempFile("", "testcert")
5360
assert.Nil(t, err, "Error creating temp cert file")
@@ -158,7 +165,7 @@ func TestCertFromSSLCAPathEnv(t *testing.T) {
158165

159166
func TestCertVerifyDisabledGlobalEnv(t *testing.T) {
160167
empty, _ := NewClient(nil)
161-
httpClient := empty.HttpClient("anyhost.com")
168+
httpClient := clientForHost(empty, "anyhost.com")
162169
tr, ok := httpClient.Transport.(*http.Transport)
163170
if assert.True(t, ok) {
164171
assert.False(t, tr.TLSClientConfig.InsecureSkipVerify)
@@ -170,7 +177,7 @@ func TestCertVerifyDisabledGlobalEnv(t *testing.T) {
170177

171178
assert.Nil(t, err)
172179

173-
httpClient = c.HttpClient("anyhost.com")
180+
httpClient = clientForHost(c, "anyhost.com")
174181
tr, ok = httpClient.Transport.(*http.Transport)
175182
if assert.True(t, ok) {
176183
assert.True(t, tr.TLSClientConfig.InsecureSkipVerify)
@@ -179,7 +186,7 @@ func TestCertVerifyDisabledGlobalEnv(t *testing.T) {
179186

180187
func TestCertVerifyDisabledGlobalConfig(t *testing.T) {
181188
def, _ := NewClient(nil)
182-
httpClient := def.HttpClient("anyhost.com")
189+
httpClient := clientForHost(def, "anyhost.com")
183190
tr, ok := httpClient.Transport.(*http.Transport)
184191
if assert.True(t, ok) {
185192
assert.False(t, tr.TLSClientConfig.InsecureSkipVerify)
@@ -190,7 +197,7 @@ func TestCertVerifyDisabledGlobalConfig(t *testing.T) {
190197
}))
191198
assert.Nil(t, err)
192199

193-
httpClient = c.HttpClient("anyhost.com")
200+
httpClient = clientForHost(c, "anyhost.com")
194201
tr, ok = httpClient.Transport.(*http.Transport)
195202
if assert.True(t, ok) {
196203
assert.True(t, tr.TLSClientConfig.InsecureSkipVerify)
@@ -199,13 +206,13 @@ func TestCertVerifyDisabledGlobalConfig(t *testing.T) {
199206

200207
func TestCertVerifyDisabledHostConfig(t *testing.T) {
201208
def, _ := NewClient(nil)
202-
httpClient := def.HttpClient("specifichost.com")
209+
httpClient := clientForHost(def, "specifichost.com")
203210
tr, ok := httpClient.Transport.(*http.Transport)
204211
if assert.True(t, ok) {
205212
assert.False(t, tr.TLSClientConfig.InsecureSkipVerify)
206213
}
207214

208-
httpClient = def.HttpClient("otherhost.com")
215+
httpClient = clientForHost(def, "otherhost.com")
209216
tr, ok = httpClient.Transport.(*http.Transport)
210217
if assert.True(t, ok) {
211218
assert.False(t, tr.TLSClientConfig.InsecureSkipVerify)
@@ -216,13 +223,13 @@ func TestCertVerifyDisabledHostConfig(t *testing.T) {
216223
}))
217224
assert.Nil(t, err)
218225

219-
httpClient = c.HttpClient("specifichost.com")
226+
httpClient = clientForHost(c, "specifichost.com")
220227
tr, ok = httpClient.Transport.(*http.Transport)
221228
if assert.True(t, ok) {
222229
assert.True(t, tr.TLSClientConfig.InsecureSkipVerify)
223230
}
224231

225-
httpClient = c.HttpClient("otherhost.com")
232+
httpClient = clientForHost(c, "otherhost.com")
226233
tr, ok = httpClient.Transport.(*http.Transport)
227234
if assert.True(t, ok) {
228235
assert.False(t, tr.TLSClientConfig.InsecureSkipVerify)

0 commit comments

Comments
 (0)