All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Johannes Löthberg" <johannes@kyriasis.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH/RFC] upload-pack: Fail if cloning empty namespace
Date: Fri, 12 Jun 2015 14:01:29 -0700	[thread overview]
Message-ID: <xmqq616sd4k6.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1434140115-3139-1-git-send-email-johannes@kyriasis.com> ("Johannes Löthberg"'s message of "Fri, 12 Jun 2015 22:15:15 +0200")

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?

  reply	other threads:[~2015-06-12 21:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-12 20:15 [PATCH/RFC] upload-pack: Fail if cloning empty namespace Johannes Löthberg
2015-06-12 21:01 ` Junio C Hamano [this message]
2015-06-12 22:17 ` [PATCH v2] " Johannes Löthberg
2015-06-12 22:32   ` Johannes Löthberg
2015-06-15 20:49     ` Junio C Hamano
2015-06-20 14:27       ` Johannes Löthberg
2015-06-20 18:06         ` Junio C Hamano
2015-06-20 18:13           ` Johannes Löthberg
2015-06-20 21:20           ` Junio C Hamano
2015-06-20 21:49             ` Johannes Löthberg
2015-06-21 18:43               ` Junio C Hamano

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=xmqq616sd4k6.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=johannes@kyriasis.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.