From: Junio C Hamano <gitster@pobox.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: "Nick Townsend" <nick.townsend@mac.com>,
"Git List" <git@vger.kernel.org>, "René Scharfe" <l.s.r@web.de>,
"Jens Lehmann" <Jens.Lehmann@web.de>,
"Heiko Voigt" <hvoigt@hvoigt.net>
Subject: Re: [PATCH] Improvements to git-archive tests and add_submodule_odb()
Date: Tue, 03 Dec 2013 09:54:03 -0800 [thread overview]
Message-ID: <xmqq61r5q0qs.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CAPig+cTUjvfWLC5vX0=BwtSDb613E9jMoyVXWp=de_Tyb5Ei7w@mail.gmail.com> (Eric Sunshine's message of "Tue, 3 Dec 2013 04:26:05 -0500")
Eric Sunshine <sunshine@sunshineco.com> writes:
>> +test_expect_success 'archive subtree from subdir' '
>> + cd a &&
>> + git archive --format=tar HEAD >../asubtree.tar &&
>> + cd .. &&
>> + make_dir extract &&
>> + "$TAR" xf asubtree.tar -C extract &&
>> + check_dir extract af b b/bf b/c b/c/cf
>> +'
>
> If git-archive fails, the subsequent 'cd ..' will not be invoked,
> hence all tests following this one will fail since the current
> directory has not been restored. If you place the 'cd a' in a
> subshell, then the current directory remains unchanged for commands
> outside the subshell (and you can drop the 'cd ..'):
>
> (
> cd a &&
> git archive ...
> ) &&
> make_dir ...
> ...
Thanks, and please indent the commands run in the subshell for
better readability.
next prev parent reply other threads:[~2013-12-03 17:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-03 0:10 [PATCH] Improvements to git-archive tests and add_submodule_odb() Nick Townsend
2013-12-03 0:14 ` Nick Townsend
2013-12-03 17:52 ` Junio C Hamano
2013-12-03 18:18 ` Heiko Voigt
2013-12-03 18:39 ` Re* " Junio C Hamano
2013-12-03 20:42 ` Heiko Voigt
2013-12-03 0:16 ` Nick Townsend
2013-12-03 9:26 ` Eric Sunshine
2013-12-03 17:54 ` Junio C Hamano [this message]
2013-12-05 2:49 ` [PATCH] Additional git-archive tests Nick Townsend
2013-12-05 19:52 ` Junio C Hamano
2013-12-10 5:26 ` Nick Townsend
2013-12-10 18:48 ` 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=xmqq61r5q0qs.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=Jens.Lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=hvoigt@hvoigt.net \
--cc=l.s.r@web.de \
--cc=nick.townsend@mac.com \
--cc=sunshine@sunshineco.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.