Skip to content

Git fetch fails with too long branches since 2.48.1 #5476

Closed
@JohnnyDoesStuff

Description

@JohnnyDoesStuff

Since git 2.48.1 i got issues when fetching long branches from a repository (usecase: The repository should be fetched by Jenkins, so path lengths get past 260 characters).

Steps to reproduce:

  1. Have a git repository with a branch that has a long name
  2. Create a directory with a very long name
  3. Open git in that directory
  4. git init
  5. git fetch --no-tags --force --progress --prune -- https://github.com/foo/bar.git +refs/heads/*:refs/remotes/origin/*

Expected result
Everything is fetched (When executing this with git 2.47.1 it works)

Actual Result
For the long branches i get these error messages:

error: couldn't set 'refs/remotes/origin/foo/loooooooooooooooong_branch_name'
! [new branch]          foo/loooooooooooooooong_branch_name -> origin/foo/loooooooooooooooong_branch_name  (unable to update local ref)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions