-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Cannot "git pull" if any remote branch contains invalid char - regression from 2.21 to 2.24 #2438
Comments
This does not appear to be a new bug, actually. It was just hidden by yet another bug, and now it is made obvious. In their unpacked format, refs (including branch names) are represented as files, and file names with a trailing dot are illegal on Windows. If you try to write them, though, no error will be thrown, but the file name without a trailing dot will be used automatically. Which means: if you have a branch name In short: you are hitting a bug that was ignored for years, and that is no longer ignored as of v2.24.1(2). |
I think I have encountered the same error in git version 2.25.0.windows.1 |
Has this been fixed in the new V2.26 release? Worth testing. I'm not sure if the fixes mentioned are in the upstream yet. Just a thought. https://github.com/git-for-windows/git/releases/ |
I highly doubt that the file would have been renamed in the indicated manner. Instead, the file would be marked as |
I'm using Git 2.18 and that's what I'm experiencing. But that's less important. What matters is the failure of version 2.25 to clone the repository. |
I disagree. As long as we do not understand how on earth your Git (for Windows?) v2.18 can munge the path of an otherwise illegal file name, we won't understand how to address this properly. You could try setting |
All I can say is that this is what I have experienced with this repository on older versions of Git for Windows on Windows 10. It's never borthered me since the particular file was not important to me. But now where it prevents cloning the repo on Windows it's a different matter. |
I see (for the record):
Is that what you see? Do check the final restore command. The option you need is likely not the suggested one. |
Yes, I expected pretty much precisely what @PhilipOakley sees. |
While the clone ended with advice I'm not up on usage of the restore command but if it really need all the deleted files to be listed for unstaging, it's perhaps not a helpful as needed, but hopefully a closer reading of the man page would 'do the right thing'. It could be that in this (initial clone) case we have commands/advice acting at cross purposes i.e. unstage a deletion vs git add untracked files (from the status report)? |
Setup
defaults?
to the issue you're seeing?
The problem appears related to a branch name containing a dot/period character. You should be able to reproduce the problem with a remote branch named
branch./name
.Details
Cmd.
Minimal, Complete, and Verifiable example
this will help us understand the issue.
I expected git to update its local state (git fetch behavior), log an error for the branch with the invalid name, and then update the state of master to match origin/master.
Git updated its local state, logged an error, and then exited, leaving master in its previous state (X commits behind origin/master).
URL to that repository to help us with testing?
N/A.
Additional thoughts: it occurs to me that this behavior may be by design / a "bugfix" - exiting with a failed error code where an error was previously silently ignored. However, it doesn't seem right that a badly named remote without a corresponding local branch would block "git pull" in master.
Workaround: it is possible to workaround this bug by using "git merge <tip of remote>" instead of "git pull"
The text was updated successfully, but these errors were encountered: