Subject: Re: [PATCH] More test cases for sanitized path names

From: Junio C Hamano <[email-masked]>
Date: Fri, 07 Mar 2008 00:23:54 -0800

Robin Rosenberg <[email-masked]> writes:

> Verify a few more commands and pathname variants.
>
> Signed-off-by: Robin Rosenberg <[email-masked]>
> ---
>  t/t7010-setup.sh |   39 +++++++++++++++++++++++++++++++++++++++
>  1 files changed, 39 insertions(+), 0 deletions(-)
>
> These are a few testcases from my earlier attempt at this. The
> log and commit cases succeeded with Junios version, but not 
> blame and some of the nastier versions for git add (same
> principle for all commands, just that I use add as an example)

I am very sorry about replying to an ancient topic, but I think I misread
your patch.

> +test_expect_failure 'add a directory outside the work tree' '
> +	d1="$(cd .. ; pwd)" &&
> +	git add "$d1"
> +	echo $?
> +'

What I think I misunderstood was that you _wanted_ this (after removing
the "echo", which was a mistake, which we already talked about) to fail.
Somehow I ended up committing test_expect_success, which I think was a
mistake, and I am asking for a sanity-check.

Likewise for the other two tests.  These "add outside" should fail, right?

> +test_expect_failure 'add a file outside the work tree, nasty case 1' '(
> +	f="$(pwd)x" &&
> +	touch "$f" &&
> +	git add "$f"
> +)'
> +
> +test_expect_failure 'add a file outside the work tree, nasty case 2' '(
> +	f="$(pwd|sed "s/.$//")x" &&
> +	touch "$f" &&
> +	git add "$f"
> +)'
> +
>  test_done