mirror of
https://github.com/git/git
synced 2024-09-13 21:34:42 +00:00
t5500-fetch-pack: remove local (bashism) usage.
None of the variables seem to conflict, so local was unnecessary. Also replaced ${var:pos:len} with the sed equivalent. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
c7053aa88f
commit
1010437d51
|
@ -12,11 +12,11 @@ test_description='Testing multi_ack pack fetching
|
||||||
|
|
||||||
# Some convenience functions
|
# Some convenience functions
|
||||||
|
|
||||||
function add () {
|
add () {
|
||||||
local name=$1
|
name=$1
|
||||||
local text="$@"
|
text="$@"
|
||||||
local branch=${name:0:1}
|
branch=`echo $name | sed -e 's/^\(.\).*$/\1/'`
|
||||||
local parents=""
|
parents=""
|
||||||
|
|
||||||
shift
|
shift
|
||||||
while test $1; do
|
while test $1; do
|
||||||
|
@ -36,13 +36,13 @@ function add () {
|
||||||
eval ${branch}TIP=$commit
|
eval ${branch}TIP=$commit
|
||||||
}
|
}
|
||||||
|
|
||||||
function count_objects () {
|
count_objects () {
|
||||||
ls .git/objects/??/* 2>>log2.txt | wc -l | tr -d " "
|
ls .git/objects/??/* 2>>log2.txt | wc -l | tr -d " "
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_expect_object_count () {
|
test_expect_object_count () {
|
||||||
local message=$1
|
message=$1
|
||||||
local count=$2
|
count=$2
|
||||||
|
|
||||||
output="$(count_objects)"
|
output="$(count_objects)"
|
||||||
test_expect_success \
|
test_expect_success \
|
||||||
|
@ -50,18 +50,18 @@ function test_expect_object_count () {
|
||||||
"test $count = $output"
|
"test $count = $output"
|
||||||
}
|
}
|
||||||
|
|
||||||
function pull_to_client () {
|
pull_to_client () {
|
||||||
local number=$1
|
number=$1
|
||||||
local heads=$2
|
heads=$2
|
||||||
local count=$3
|
count=$3
|
||||||
local no_strict_count_check=$4
|
no_strict_count_check=$4
|
||||||
|
|
||||||
cd client
|
cd client
|
||||||
test_expect_success "$number pull" \
|
test_expect_success "$number pull" \
|
||||||
"git-fetch-pack -k -v .. $heads"
|
"git-fetch-pack -k -v .. $heads"
|
||||||
case "$heads" in *A*) echo $ATIP > .git/refs/heads/A;; esac
|
case "$heads" in *A*) echo $ATIP > .git/refs/heads/A;; esac
|
||||||
case "$heads" in *B*) echo $BTIP > .git/refs/heads/B;; esac
|
case "$heads" in *B*) echo $BTIP > .git/refs/heads/B;; esac
|
||||||
git-symbolic-ref HEAD refs/heads/${heads:0:1}
|
git-symbolic-ref HEAD refs/heads/`echo $heads | sed -e 's/^\(.\).*$/\1/'`
|
||||||
|
|
||||||
test_expect_success "fsck" 'git-fsck-objects --full > fsck.txt 2>&1'
|
test_expect_success "fsck" 'git-fsck-objects --full > fsck.txt 2>&1'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue