Re: [PATCH] Improvements to git-archive tests and add_submodule_odb()

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

 



Eric Sunshine <sunshine@xxxxxxxxxxxxxx> 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.
--
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]