From: "David Symonds" <dsymonds@gmail.com>
To: "Johannes Sixt" <j.sixt@viscovery.net>
Cc: "Junio C Hamano" <gitster@pobox.com>,
git@vger.kernel.org,
"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
"Andreas Ericsson" <ae@op5.se>
Subject: Re: [PATCH] git-checkout: Test for relative path use.
Date: Fri, 9 Nov 2007 18:24:15 +1100 [thread overview]
Message-ID: <ee77f5c20711082324s39a9d441tc05c5a27e6d39f3e@mail.gmail.com> (raw)
In-Reply-To: <47340895.6000403@viscovery.net>
On Nov 9, 2007 6:13 PM, Johannes Sixt <j.sixt@viscovery.net> 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.
next prev parent reply other threads:[~2007-11-09 7:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-09 0:36 [PATCH] git-checkout: Support relative paths containing ".." David Symonds
2007-11-09 0:36 ` [PATCH] git-checkout: Test for relative path use David Symonds
2007-11-09 1:28 ` Junio C Hamano
2007-11-09 1:44 ` David Symonds
2007-11-09 1:54 ` Junio C Hamano
2007-11-09 1:57 ` David Symonds
2007-11-09 19:48 ` Robin Rosenberg
2007-11-09 7:13 ` Johannes Sixt
2007-11-09 7:24 ` David Symonds [this message]
2007-11-09 7:37 ` David Symonds
2007-11-09 8:04 ` Junio C Hamano
2007-11-09 8:14 ` David Symonds
2007-11-09 9:06 ` Junio C Hamano
2007-11-09 9:10 ` David Symonds
2007-11-09 9:12 ` David Symonds
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=ee77f5c20711082324s39a9d441tc05c5a27e6d39f3e@mail.gmail.com \
--to=dsymonds@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=ae@op5.se \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j.sixt@viscovery.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).