Re: [PATCH 10/10] fetch tests: fix needless and buggy re-quoting
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 22, 2022, 06:12 UTC
- Message-ID
- <xmqqsfnx6xbh.fsf@gitster.g>
- In-Reply-To
- <patch-10.10-54129b94a77-20220621T222854Z-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> - remote_url="file://$TRASH_DIRECTORY/." && # NOT local yet! > - local cmdline_setup="\"$remote_url\" \"$refspec_heads\""
Good riddance ;-)
Show 15 quoted lines
> + local remote_url="file://$TRASH_DIRECTORY/." &&
>
> ...
> - git fetch '"$cmdline_setup"' &&
> + git fetch "$remote_url" "$refspec_heads" &&
> ...
> + git$git_fetch_c fetch \
> + ${arg_fetch_prune:+--prune} \
> + ${arg_fetch_no_prune:+--no-prune} \
> + ${arg_fetch_prune_tags:+--prune-tags} \
> + ${arg_fetch_origin:+origin} \
> + ${arg_fetch_url:+"$remote_url"} \
> + ${arg_fetch_refspec_tags:+"refs/tags/*:refs/tags/*"} \
> + ${arg_fetch_refspec_heads:+"+refs/heads/*:refs/remotes/origin/*"} &&
> +This makes it a lot clearer, with no perl, no sed, no eval. It does become louder, but should be easier to follow in general ...
> test_configured_prune_type --mode link true unset true unset pruned pruned \ > - "\"$remote_url\"" \ > + REMOTE_URL \ > "refs/tags/*:refs/tags/*" "+refs/heads/*:refs/remotes/origin/*"
... except for a magic like this one.
We may remember the REMOTE_URL -> $remote_url trick used here this week, but I am not sure if we find it sensible in 3 months.
But overall I think this makes it simpler. I am not 100% sold on the necessity of lengthy earlier steps, though.
Thanks.