Re: [PATCH v3 6/7] git-submodule.sh: improve variables readability
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 11, 2024, 06:09 UTC
- Message-ID
- <xmqq4j3akayp.fsf@gitster.g>
- In-Reply-To
- <Z1jxSJKl8nwGbYa5@danh.dev>
Đoàn Trần Công Danh <congdanhqx@gmail.com> writes:
Show 8 quoted lines
>> --reference=*)
>> - reference_path="${1#--reference=}"
>> + reference="$1"
>
> --reference takes a path to some repository,
> (see also git-clone --reference),
> thus it can have any characters, including but not limit to whitespace.
> I think we need to discard this hunk!I didn't double check the code that uses the variable, but as long as the code that uses $reference writs it correctly, e.g.
git subcmd ${reference:+"$reference"} ...it should correctly pass what it received in the above assignment from the user in $1 just fine, even if its value can contain any arbitrary byte, I would think.