Skip to content

Cannot "git pull" if any remote branch contains invalid char - regression from 2.21 to 2.24 #2438

@will-bartlett

Description

@will-bartlett
  • [ x ] I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.24.1.windows.2
cpu: x86_64
built from commit: 992f0773022527b1b0cb1e0c13aec97dd5248053
sizeof-long: 4
sizeof-size_t: 8
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.18363.535]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Editor Option: VisualStudioCode
Custom Editor Path:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: WinSSL
CRLF Option: CRLFAlways
Bash Terminal Option: ConHost
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Enabled
Enable Builtin Interactive Add: Disabled
  • Any other interesting things about your environment that might be related
    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

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Cmd.

git checkout master
git pull
  • What did you expect to occur after running these commands?

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.

  • What actually happened instead?

Git updated its local state, logged an error, and then exited, leaving master in its previous state (X commits behind origin/master).

  • If the problem was occurring with a specific repository, can you provide the
    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"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions