Re: [PATCH] git-checkout: Test for relative path use.

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

 



On Nov 9, 2007 6:13 PM, Johannes Sixt <j.sixt@xxxxxxxxxxxxx> wrote:
> David Symonds schrieb:
> > +test_expect_success 'remove and restore with relative path' '
> > +
> > +     cd dir1 &&
> > +     rm ../file0 &&
> > +     git checkout HEAD -- ../file0 &&
> > +     test "base" = "$(cat ../file0)" &&
> > +     rm ../dir2/file2 &&
> > +     git checkout HEAD -- ../dir2/file2 &&
> > +     test "bonjour" = "$(cat ../dir2/file2)" &&
> > +     rm ../file0 ./file1 &&
> > +     git checkout HEAD -- .. &&
> > +     test "base" = "$(cat ../file0)" &&
> > +     test "hello" = "$(cat file1)" &&
> > +     cd -
>
> What if this test fails? Then the rest of the tests run from the wrong
> directory. You should put the test in parenthesis (and drop the cd -).

Looking at the existing tests which, when they change directories,
don't cd back to where they were; they "cd .." at the start of the
next test. I'll add a "cd .." to the relevant bits of my tests.


Dave.
-
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