Git Mailing List Archive mirror
 help / color / mirror / Atom feed
From: Azat <spektrokalter@gmail.com>
To: git@vger.kernel.org
Subject: bug: `git fetch origin main:main` fails when main is HEAD
Date: Fri, 17 May 2024 00:14:58 +0500	[thread overview]
Message-ID: <CAH68kYk-0kaXGeX+ZTXv3MutnX0Y=CmkEK660RC+V7+fXJc-Pw@mail.gmail.com> (raw)

Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)

Clone a repository and run this command:

git fetch origin main:main

What did you expect to happen? (Expected behavior)

Nothing extraordinary happens. The branch is up to date.

What happened instead? (Actual behavior)

fatal: refusing to fetch into branch 'refs/heads/main' checked out at ''
fatal: the remote end hung up unexpectedly
remote:
remote: ========================================================================
remote:
remote: rpc error: code = Canceled desc = running upload-pack: user
canceled the request
remote:
remote: ========================================================================
remote:

Anything else you want to add:

If I checkout to another branch and run the same `git fetch` command on
this branch, the same error happens.

Further, if change HEAD but keep the same branch name, like this:

git checkout HEAD^
git checkout -B main

... then `git fetch origin main:main` fails as well.

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.45.0
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 6.8.9-arch1-2 #1 SMP PREEMPT_DYNAMIC Tue, 07 May 2024
21:35:54 +0000 x86_64
compiler info: gnuc: 13.2
libc info: glibc: 2.39
$SHELL (typically, interactive shell): /bin/sh


[Enabled Hooks]
not run from a git repository - no hooks to show

                 reply	other threads:[~2024-05-16 19:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH68kYk-0kaXGeX+ZTXv3MutnX0Y=CmkEK660RC+V7+fXJc-Pw@mail.gmail.com' \
    --to=spektrokalter@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).