@matheusbsbs / matheus-bagliano / commits / 1010437d51
Fork 0

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>

Eric Wong committed May 25, 2006 at 19:06 UTC 1010437d515a2740b7c0f3eeecf6af804062a9ff
1 file changed +15 -15
t/t5500-fetch-pack.sh
+15 -15
@@ -12,11 +12,11 @@ test_description='Testing multi_ack pack fetching
12
13 # Some convenience functions
14
15 -function add () {
16 - local name=$1
17 - local text="$@"
18 - local branch=${name:0:1}
19 - local parents=""
15 +add () {
16 + name=$1
17 + text="$@"
18 + branch=`echo $name | sed -e 's/^\(.\).*$/\1/'`
19 + parents=""
20
21 shift
22 while test $1; do
@@ -36,13 +36,13 @@ function add () {
36 eval ${branch}TIP=$commit
37 }
38
39 -function count_objects () {
39 +count_objects () {
40 ls .git/objects/??/* 2>>log2.txt | wc -l | tr -d " "
41 }
42
43 -function test_expect_object_count () {
44 - local message=$1
45 - local count=$2
43 +test_expect_object_count () {
44 + message=$1
45 + count=$2
46
47 output="$(count_objects)"
48 test_expect_success \
@@ -50,18 +50,18 @@ function test_expect_object_count () {
50 "test $count = $output"
51 }
52
53 -function pull_to_client () {
54 - local number=$1
55 - local heads=$2
56 - local count=$3
57 - local no_strict_count_check=$4
53 +pull_to_client () {
54 + number=$1
55 + heads=$2
56 + count=$3
57 + no_strict_count_check=$4
58
59 cd client
60 test_expect_success "$number pull" \
61 "git-fetch-pack -k -v .. $heads"
62 case "$heads" in *A*) echo $ATIP > .git/refs/heads/A;; esac
63 case "$heads" in *B*) echo $BTIP > .git/refs/heads/B;; esac
64 - git-symbolic-ref HEAD refs/heads/${heads:0:1}
64 + git-symbolic-ref HEAD refs/heads/`echo $heads | sed -e 's/^\(.\).*$/\1/'`
65
66 test_expect_success "fsck" 'git-fsck-objects --full > fsck.txt 2>&1'
67