@@ -8,6 +8,12 @@ checkReturnCode() {
88 fi
99}
1010
11+ BRANCH=$1
12+
13+ if [ -z $BRANCH ]; then
14+ BRANCH=default
15+ fi
16+
1117REPO1=repository1
1218REPO2=repository2
1319SCRIPT_PATH=$( dirname ` which $0 ` )
@@ -31,6 +37,7 @@ source $SCRIPT_PATH/add-hook.sh $REPO1 incoming "$NP" "$NE" "$NC"
3137ret_code=$?
3238checkReturnCode $ret_code $CLEANUP
3339
40+ source $SCRIPT_PATH /change-branch.sh $ABSOLUTE /$REPO2 $BRANCH
3441
3542source $SCRIPT_PATH /change-file.sh $ABSOLUTE /$REPO2 " file"
3643ret_code=$?
@@ -44,9 +51,9 @@ source $SCRIPT_PATH/close-branch.sh $ABSOLUTE/$REPO2
4451ret_code=$?
4552checkReturnCode $ret_code $CLEANUP
4653
47- EXPECTED_NEW=(" default " )
48- EXPECTED_EXISTING=(" default " )
49- EXPECTED_CLOSED=(" default " )
54+ EXPECTED_NEW=(" $BRANCH " )
55+ EXPECTED_EXISTING=(" $BRANCH " )
56+ EXPECTED_CLOSED=(" $BRANCH " )
5057I=0
5158while IFS=' ' read -r line || [[ -n " $line " ]]; do
5259 linearr=($line )
@@ -55,7 +62,7 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
5562 fi
5663 let " I++"
5764done < " $NEWBRANCH "
58- if [! $i -eq ${ EXPECTED_NEW[@]} ]; then
65+ if [ " $I " -ne " ${ # EXPECTED_NEW[@]}" ]; then
5966 RESULT=1
6067fi
6168I=0
@@ -68,7 +75,7 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
6875 let " I++"
6976done < " $EXISTING "
7077
71- if [! $i -eq ${ EXPECTED_EXISTING[@]} ]; then
78+ if [ " $I " -ne " ${ # EXPECTED_EXISTING[@]}" ]; then
7279 RESULT=1
7380fi
7481
@@ -82,7 +89,7 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
8289 let " I++"
8390done < " $CLOSED "
8491
85- if [! $i -eq ${ EXPECTED_CLOSED[@]} ]; then
92+ if [ " $I " -ne " ${ # EXPECTED_CLOSED[@]}" ]; then
8693 RESULT=1
8794fi
8895
0 commit comments