Skip to content

Commit e256eec

Browse files
committed
t5500 & t7403: lose bash-ism "local"
In t5500::check_prot_host_port_path(), diagport is not a variable used elsewhere and the function is not recursively called so this can simply lose the "local", which may not be supported by shell (besides, the function liberally clobbers other variables without making them "local"). t7403::reset_submodule_urls() overrides the "root" variable used in the test framework for no good reason; its use is not about temporarily relocating where the test repositories are created. This assignment can be made not to clobber the variable by moving them into the subshells it already uses. Its value is always $TRASH_DIRECTORY, so we could use it instead there, and this function that is called only once and its two subshells may not be necessary (instead, the caller can use "git -C $there config" and set a value that is derived from $TRASH_DIRECTORY), but this is a minimum fix that is needed to lose "local". Helped-by: John Keeping <[email protected]> Helped-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d2554c7 commit e256eec

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

t/t5500-fetch-pack.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,6 @@ check_prot_path () {
556556
}
557557

558558
check_prot_host_port_path () {
559-
local diagport
560559
case "$2" in
561560
*ssh*)
562561
pp=ssh

t/t7403-submodule-sync.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ test_expect_success 'change submodule' '
6262
'
6363

6464
reset_submodule_urls () {
65-
local root
66-
root=$(pwd) &&
6765
(
66+
root=$(pwd) &&
6867
cd super-clone/submodule &&
6968
git config remote.origin.url "$root/submodule"
7069
) &&
7170
(
71+
root=$(pwd) &&
7272
cd super-clone/submodule/sub-submodule &&
7373
git config remote.origin.url "$root/submodule"
7474
)

0 commit comments

Comments
 (0)