Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetching a Repository with special branch names breaks on Windows #1055

Open
calyptobai opened this issue Oct 9, 2023 · 2 comments
Open
Labels
acknowledged an issue is accepted as shortcoming to be fixed C-Windows Windows-specific issues

Comments

@calyptobai
Copy link

Current behavior 😯

Calling fetch_only on Windows for a repository with a branch named foo<1.0 fails due to:

Fetch(UpdateRefs(EditReferences(FileTransactionCommit(DeleteReference { full_name: "refs/remotes/origin/foo<1.0", err: Os { code: 123, kind: InvalidFilename, message: "The filename, directory name, or volume label syntax is incorrect." } }))))

Expected behavior 🤔

I would expect this to work on Windows, given that foo<1.0 is a well-formed name according to git's ref naming rules.

Steps to reproduce 🕹

  1. Use Windows
  2. Try to PrepareFetch and fetch_only for https://github.com/calyptobai/gix-fetch-win-fail.git
@Byron Byron added acknowledged an issue is accepted as shortcoming to be fixed C-Windows Windows-specific issues labels Oct 10, 2023
@Byron
Copy link
Owner

Byron commented Oct 10, 2023

Thanks for reporting!

git seems to be able to do it by writing packed-refs right away.

# pack-refs with: peeled fully-peeled sorted 
2f3c410f1900acbf8bb3d29f008d1f9b57103053 refs/remotes/origin/foo<1.0
2f3c410f1900acbf8bb3d29f008d1f9b57103053 refs/remotes/origin/main

gix also does that which works around issues around case-insensitivity for example, but that doesn't seem to kick in here. Instead it tries to create a file with such a name and fails.

The goal here would to figure out why it's not writing straight to packed refs.

@Byron
Copy link
Owner

Byron commented Oct 10, 2023

A quick investigation shows that…

So in this case, it's probably these the last two points to adjust and investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledged an issue is accepted as shortcoming to be fixed C-Windows Windows-specific issues
Projects
None yet
Development

No branches or pull requests

2 participants