Skip to content

*: use patched version of bgetnry/go-netrc - #3027

Merged
ttaylorr merged 2 commits into
masterfrom
fork-go-netrc
May 25, 2018
Merged

ttaylorr merged 2 commits into
masterfrom
fork-go-netrc

Conversation

@ttaylorr

@ttaylorr ttaylorr commented May 25, 2018 •

Copy link
Copy Markdown
Contributor

This pull request updates our copy of package github.com/bgentry/go-netrc to allow netrc files containing unknown keywords, fixing desktop/desktop#4745.

Here's some background: the latest version of the Heroku CLI uses non-standard keywords in the user's netrc file. The parser we had used previously is strict and has caused confusing errors such as those experienced in: #2943, #2624, #2543, & #1998.

So, broken netrc files would not be parsed by Git LFS: that's OK, since which credentials to authenticate with on non-parseable netrc files is undefined.

However, Heroku CLI intentionally adds non-standard keywords to netrc files. The trouble is that that tool knows how to interpret them, and we don't. In other words, we can't distinguish between netrc files using the Heroku CLI and broken ones.

Instead, let's loosen the netrc parsing requirements by applying a patch (see: git-lfs/go-netrc@5affb93432) that round-trips unknown keywords. Since we vendored an external package, we must first fork it (see: https://github.com/git-lfs/go-netrc) and then apply our patch on top.

Therefore, the main interesting bits aren't in this PR, rather a bunch of changes like s/bgentry/git-lfs/g, and an extra test in test/test-credentials.sh to ensure that netrc files with unknown keywords are parsed without error.

/cc @git-lfs/core desktop/desktop#4745

@ttaylorr
ttaylorr merged commit 67a5c2d into master May 25, 2018
@ttaylorr
ttaylorr deleted the fork-go-netrc branch May 25, 2018 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant