1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-27 15:46:14 +02:00
git/t/t5507-remote-environment.sh
Ævar Arnfjörð Bjarmason 1fdd31cf52 receive-pack: release the linked "struct command *" list
Fix a memory leak that's been with us since this code was introduced
in [1]. Later in [2] we started using FLEX_ALLOC_MEM() to allocate the
"struct command *".

1. 575f497456 (Add first cut at "git-receive-pack", 2005-06-29)
2. eb1af2df0b (git-receive-pack: start parsing ref update commands,
   2005-06-29)

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-02-06 15:34:40 -08:00

37 lines
849 B
Bash
Executable File

#!/bin/sh
test_description='check environment showed to remote side of transports'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'set up "remote" push situation' '
test_commit one &&
git config push.default current &&
git init remote
'
test_expect_success 'set up fake ssh' '
GIT_SSH_COMMAND="f() {
cd \"\$TRASH_DIRECTORY\" &&
eval \"\$2\"
}; f" &&
export GIT_SSH_COMMAND &&
export TRASH_DIRECTORY
'
# due to receive.denyCurrentBranch=true
test_expect_success 'confirm default push fails' '
test_must_fail git push remote
'
test_expect_success 'config does not travel over same-machine push' '
test_must_fail git -c receive.denyCurrentBranch=false push remote
'
test_expect_success 'config does not travel over ssh push' '
test_must_fail git -c receive.denyCurrentBranch=false push host:remote
'
test_done