From: Bagas Sanjaya <bagasdotme@gmail.com>
To: "Björn Kautler" <Bjoern@kautler.net>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Bug when cloning a repository with a default branch called HEAD
Date: Mon, 31 May 2021 11:01:22 +0700 [thread overview]
Message-ID: <07edafe5-d0a2-4a2c-12a2-28c163f6fdda@gmail.com> (raw)
In-Reply-To: <CAKChYSqgGRfBh68oj=Gt7q4uyS7D879aQZQiZ1RsyqaDToV+0g@mail.gmail.com>
Hi,
On 29/05/21 02.05, Björn Kautler wrote:
> Hi,
>
> I'm not right now sure why this repo is in this state or how it got
> there, but that doesn't matter.
> But if you clone it, everything is fine.
> And if you then try to fetch it, Git goes havoc:
>
I'm trying to create minimal reproducible test repo by switching initial
branch to HEAD:
$ mkdir shark && cd shark
$ git init
$ git checkout -b HEAD
But when I checkout, it returned error as expected:
> fatal: 'HEAD' is not a valid branch name.
Thus I can't reproduce this issue.
> $ git clone https://gitlab.com/Vampire/whelk.git/ && cd whelk &&
> GIT_TRACE=1 git fetch; echo $?
> Cloning into 'whelk'...
> remote: Enumerating objects: 525, done.
> remote: Counting objects: 100% (525/525), done.
> remote: Compressing objects: 100% (227/227), done.
> remote: Total 525 (delta 280), reused 525 (delta 280), pack-reused 0
> Receiving objects: 100% (525/525), 165.63 KiB | 3.52 MiB/s, done.
> Resolving deltas: 100% (280/280), done.
> 21:04:15.761530 exec-cmd.c:237 trace: resolved executable
> dir: C:/Program Files/Git/mingw64/bin
> 21:04:15.765532 git.c:447 trace: built-in: git fetch
> warning: refname 'HEAD' is ambiguous.
> 21:04:15.769530 run-command.c:667 trace: run_command:
> GIT_DIR=.git git remote-https origin
> https://gitlab.com/Vampire/whelk.git/
> 21:04:15.795532 exec-cmd.c:237 trace: resolved executable
> dir: C:/Program Files/Git/mingw64/libexec/git-core
> 21:04:15.799535 git.c:734 trace: exec: git-remote-https
> origin https://gitlab.com/Vampire/whelk.git/
> 21:04:15.799535 run-command.c:667 trace: run_command:
> git-remote-https origin https://gitlab.com/Vampire/whelk.git/
> 21:04:15.832533 exec-cmd.c:237 trace: resolved executable
> dir: C:/Program Files/Git/mingw64/libexec/git-core
> 21:04:16.438060 run-command.c:667 trace: run_command: git
> rev-list --objects --stdin --not --all --quiet --alternate-refs
> 21:04:16.461060 run-command.c:667 trace: run_command: git
> rev-list --objects --stdin --not --all --quiet --alternate-refs
> 21:04:16.475738 exec-cmd.c:237 trace: resolved executable
> dir: C:/Program Files/Git/mingw64/libexec/git-core
> 21:04:16.478705 git.c:447 trace: built-in: git rev-list
> --objects --stdin --not --all --quiet --alternate-refs
> error: multiple updates for 'refs/remotes/origin/HEAD' (including one
> via symref 'refs/remotes/origin/HEAD') are not allowed
> From https://gitlab.com/Vampire/whelk
> ! [new branch] HEAD -> origin/HEAD (unable to update local ref)
> error: some local refs could not be updated; try running
> 'git remote prune origin' to remove any old, conflicting branches
> 21:04:16.496254 run-command.c:667 trace: run_command: git
> maintenance run --auto --no-quiet
> 21:04:16.510254 exec-cmd.c:237 trace: resolved executable
> dir: C:/Program Files/Git/mingw64/libexec/git-core
> 21:04:16.512256 git.c:447 trace: built-in: git
> maintenance run --auto --no-quiet
> 1
>
> Cheers
> Björn
>
The remote [1] might misconfigured default branch, so instead of
master/main it pointed to HEAD, and it caused the issue.
Thanks.
[1]: https://gitlab.com/Vampire/whelk
--
An old man doll... just what I always wanted! - Clara
next prev parent reply other threads:[~2021-05-31 4:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-28 19:05 Bug when cloning a repository with a default branch called HEAD Björn Kautler
2021-05-31 4:01 ` Bagas Sanjaya [this message]
2021-05-31 4:37 ` asymptosis
[not found] ` <CAKChYSrQ3u3yH0+8Fwj-84cnAFGvuSEPHx+5Mcy8Ys4sXcN14A@mail.gmail.com>
2021-05-31 20:38 ` Fwd: " Björn Kautler
2021-05-31 20:45 ` Randall S. Becker
[not found] ` <CAKChYSpjOZa2F_mE_7--htzaQ1V4zWgYi8Wm4GHOiYnWoAiswA@mail.gmail.com>
2021-05-31 20:57 ` Björn Kautler
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=07edafe5-d0a2-4a2c-12a2-28c163f6fdda@gmail.com \
--to=bagasdotme@gmail.com \
--cc=Bjoern@kautler.net \
--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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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).