[PATCH 08/10] fetch tests: remove shelling out for previously "lazy" variables

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

 



Amend the variable assignments added in e1790f9245f (fetch tests:
fetch <url> <spec> as well as fetch [<remote>], 2018-02-09). As of the
last commit this test was slower as we'd do this on every run, but it
was easier to see what was going on.

But let's instead set this on the basis of $TRASH_DIRECTORY, which is
a lot more obvious than the roundabout way of getting the
configuration from the repo that we created earlier with:

    git clone . one

Subsequent commits will make use of the new "$refspec_heads" for other
purposes, so let's declare it as a variable, and use it instead of
"$remote_fetch".

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx>
---
 t/t5510-fetch.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 7cfef0082c0..54c7c86e5ca 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -837,6 +837,8 @@ test_configured_prune_type () {
 		shift
 	done &&
 
+	local refspec_heads='+refs/heads/*:refs/remotes/origin/*' &&
+
 	local fetch_prune="$1" &&
 	local remote_origin_prune="$2" &&
 	local fetch_prune_tags="$3" &&
@@ -846,9 +848,8 @@ test_configured_prune_type () {
 	shift 6 &&
 	local cmdline="$@" &&
 
-	remote_url="file://$(git -C one config remote.origin.url)" &&
-	remote_fetch="$(git -C one config remote.origin.fetch)" &&
-	cmdline_setup="\"$remote_url\" \"$remote_fetch\"" &&
+	local remote_url="file://$TRASH_DIRECTORY/." &&
+	local cmdline_setup="\"$remote_url\" \"$refspec_heads\""
 
 	if test "$mode" = 'link'
 	then
-- 
2.36.1.1239.gfba91521d90




[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]

  Powered by Linux