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

Re: [PATCH/RFC] upload-pack: Fail if cloning empty namespace

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 12, 2015, 21:01 UTC
Message-ID
<xmqq616sd4k6.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1434140115-3139-1-git-send-email-johannes@kyriasis.com>
Johannes Löthberg <johannes@kyriasis.com> writes:
> +	if (get_git_namespace() && !symref.items) {
> +		die("git upload-pack: tried to clone from empty namespace");
> +	}
Is this sufficient?

get_git_namespace() returns environment.c::namespace, which is set up in setup_git_env() by calling expand_namespace() and strlen() is run on that value, so I would presume the function will *ALWAYS* return true. Even when not namespaced, you would get an empty string "" whose address is not NULL, no?

Previous: Johannes LöthbergNext: Johannes Löthberg
Message 2 of 11 in “upload-pack: Fail if cloning empty namespace”
  1. upload-pack: Fail if cloning empty namespaceJohannes Löthberg, Jun 12, 2015
  2. Junio C HamanoJun 12, 2015
  3. upload-pack: Fail if cloning empty namespaceJohannes Löthberg, Jun 12, 2015
  4. Johannes LöthbergJun 12, 2015
  5. Junio C HamanoJun 15, 2015
  6. Johannes LöthbergJun 20, 2015
  7. Junio C HamanoJun 20, 2015
  8. Johannes LöthbergJun 20, 2015
  9. Junio C HamanoJun 20, 2015
  10. Johannes LöthbergJun 20, 2015
  11. Junio C HamanoJun 21, 2015

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.