Skip to content

Fix git lfs for github fetcher#15891

Draft
lisanna-dettwyler wants to merge 1 commit into
NixOS:masterfrom
lisanna-dettwyler:fix-lfs-url
Draft

Fix git lfs for github fetcher#15891
lisanna-dettwyler wants to merge 1 commit into
NixOS:masterfrom
lisanna-dettwyler:fix-lfs-url

Conversation

@lisanna-dettwyler
Copy link
Copy Markdown
Contributor

@lisanna-dettwyler lisanna-dettwyler commented May 20, 2026

According to
https://github.com/git-lfs/git-lfs/blob/main/docs/api/server-discovery.md LFS endpoints must end in .git.

Resolves #15285

Motivation

Attempting to use LFS with a github fetcher can fail with HTTP 422 without this.

Context

Confirmed the fix works in #15285


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@github-actions github-actions Bot added the fetching Networking with the outside (non-Nix) world, input locking label May 20, 2026
@lisanna-dettwyler lisanna-dettwyler force-pushed the fix-lfs-url branch 4 times, most recently from d40fdcc to 61375c3 Compare May 20, 2026 22:17
According to
https://github.com/git-lfs/git-lfs/blob/main/docs/api/server-discovery.md
LFS endpoints must end in `.git`.

Resolves NixOS#15285

Signed-off-by: Lisanna Dettwyler <lisanna.dettwyler@gmail.com>
Comment on lines +8 to +22
struct GitLFSTest : public ::testing::Test
{
void test(std::string input, std::string expected)
{
ASSERT_EQ(getLfsApi(parseURL(input)).endpoint, expected);
}
};

TEST_F(GitLFSTest, get_lfs_api)
{
test("https://git-server.com/foo/bar", "https://git-server.com/foo/bar.git/info/lfs");
test("https://git-server.com/foo/bar.git", "https://git-server.com/foo/bar.git/info/lfs");
test("https://git-server.com", "https://git-server.com/.git/info/lfs");
test("https://git-server.com/foo/bar/", "https://git-server.com/foo/bar.git//info/lfs");
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can also be a parametrised test if we want to get fancy :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Via TEST_P

@lisanna-dettwyler lisanna-dettwyler marked this pull request as draft May 20, 2026 22:31
@lisanna-dettwyler
Copy link
Copy Markdown
Contributor Author

I need to look at the corner cases for remotes ending in a slash, marking as draft for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fetching Networking with the outside (non-Nix) world, input locking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Git LFS with lfs = true fails

2 participants