{"thread":{"id":"61493","subject":"bug: `git fetch origin main:main` fails when main is HEAD","startedAt":"2024-05-16T19:15:09Z","lastAt":"2024-05-16T19:15:09Z","messageCount":1,"participants":["Azat"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"494910","messageId":"CAH68kYk-0kaXGeX+ZTXv3MutnX0Y=CmkEK660RC+V7+fXJc-Pw@mail.gmail.com","threadId":"61493","inReplyTo":null,"subject":"bug: `git fetch origin main:main` fails when main is HEAD","fromName":"Azat","fromEmail":"spektrokalter@gmail.com","sentAt":"2024-05-16T19:14:58Z","receivedAt":"2024-05-16T19:15:09Z","isPatch":false,"sender":{"key":"spektrokalter@gmail.com","avatar":null},"body":"Thank you for filling out a Git bug report!\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\n\nClone a repository and run this command:\n\ngit fetch origin main:main\n\nWhat did you expect to happen? (Expected behavior)\n\nNothing extraordinary happens. The branch is up to date.\n\nWhat happened instead? (Actual behavior)\n\nfatal: refusing to fetch into branch 'refs/heads/main' checked out at ''\nfatal: the remote end hung up unexpectedly\nremote:\nremote: ========================================================================\nremote:\nremote: rpc error: code = Canceled desc = running upload-pack: user\ncanceled the request\nremote:\nremote: ========================================================================\nremote:\n\nAnything else you want to add:\n\nIf I checkout to another branch and run the same `git fetch` command on\nthis branch, the same error happens.\n\nFurther, if change HEAD but keep the same branch name, like this:\n\ngit checkout HEAD^\ngit checkout -B main\n\n... then `git fetch origin main:main` fails as well.\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.45.0\ncpu: x86_64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Linux 6.8.9-arch1-2 #1 SMP PREEMPT_DYNAMIC Tue, 07 May 2024\n21:35:54 +0000 x86_64\ncompiler info: gnuc: 13.2\nlibc info: glibc: 2.39\n$SHELL (typically, interactive shell): /bin/sh\n\n\n[Enabled Hooks]\nnot run from a git repository - no hooks to show\n"}]}