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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Den Friday 07 March 2008 09.23.54 skrev Junio C Hamano:
> Robin Rosenberg <robin.rosenberg.lists@xxxxxxxxxx> writes:
> > Verify a few more commands and pathname variants.
> >
> > Signed-off-by: Robin Rosenberg <robin.rosenberg@xxxxxxxxxx>
> > ---
> >  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.
Yes, it should fail, so according to your filosophy, the test should be 
reverted, i.e. ! git add "$d1 and that negated test should pass.

> 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

Yes.

-- robin
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux