git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git checkout creates strange '(null)'-branch

From
Junio C Hamano <gitster@pobox.com>
Date
May 8, 2012, 15:19 UTC
Message-ID
<7v62c6zon4.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CABPQNSZbgZsQBReSqOskNQ4oZokHSibVr=yHdn6oSFjtdRvVVA@mail.gmail.com>
Erik Faye-Lund <kusmabite@gmail.com> writes:
> +	test_create_repo empty-repo &&
> +	git submodule add ./empty-repo empty-submodule

You have an empty-repo but that is not part of the superproject; the superproject will have empty-submodule submodule which is a clone of empty-repo.

    $ git submodule add ./empty-repo empty-submodule
    Cloning into 'empty-submodule'...
    warning: You appear to have cloned an empty repository.
    done.

And after that, without you doing anything in empty-submodule, that repository already exhibits the (null) problem. Perhaps somebody, after calling a successfull "git clone" of an empty repository (which is a silly thing to do to begin with, with or without submodules involved, but at least we do have a defined semantics of what happens when you do that), tried to run "git checkout", even though there is nothing to be checked out? The culprit in that case to suspect would be "git submodule" script. Does it blindly assume that it can do a "git checkout" and runs that command?

Previous: Junio C HamanoNext: Erik Faye-Lund
Message 10 of 12 in “git checkout creates strange '(null)'-branch”
  1. Erik Faye-LundMay 8, 2012
  2. Johannes SixtMay 8, 2012
  3. Erik Faye-LundMay 8, 2012
  4. Andreas SchwabMay 8, 2012
  5. Junio C HamanoMay 8, 2012
  6. Erik Faye-LundMay 10, 2012
  7. Junio C HamanoMay 10, 2012
  8. Junio C HamanoMay 8, 2012
  9. Junio C HamanoMay 8, 2012
  10. Junio C HamanoMay 8, 2012
  11. Erik Faye-LundMay 8, 2012
  12. Junio C HamanoMay 8, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.