Re: [PATCH] Improvements to git-archive tests and add_submodule_odb()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 3, 2013, 17:54 UTC
- Message-ID
- <xmqq61r5q0qs.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <CAPig+cTUjvfWLC5vX0=BwtSDb613E9jMoyVXWp=de_Tyb5Ei7w@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 21 quoted lines
>> +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.