git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Eric SunshineNext: Nick Townsend
Message 9 of 13 in “Improvements to git-archive tests and add_submodule_odb()”
  1. Improvements to git-archive tests and add_submodule_odb()Nick Townsend, Dec 3, 2013
  2. Nick TownsendDec 3, 2013
  3. Junio C HamanoDec 3, 2013
  4. Heiko VoigtDec 3, 2013
  5. Re* [PATCH] Improvements to git-archive tests and add_submodule_odb()Junio C Hamano, Dec 3, 2013
  6. Heiko VoigtDec 3, 2013
  7. Nick TownsendDec 3, 2013
  8. Eric SunshineDec 3, 2013
  9. Junio C HamanoDec 3, 2013
  10. Additional git-archive testsNick Townsend, Dec 5, 2013
  11. Junio C HamanoDec 5, 2013
  12. Nick TownsendDec 10, 2013
  13. Junio C HamanoDec 10, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.