-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_script.sh
More file actions
24 lines (21 loc) · 922 Bytes
/
test_script.sh
File metadata and controls
24 lines (21 loc) · 922 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
if [ "fff10e3e2104a741168da6ec3c90b423e08fa767" == "0000000000000000000000000000000000000000" ]; then
git fetch origin master
git checkout master
mapfile -t COMMITS_ARRAY < <(git log --pretty=format:"'<code>%h</code>' - %an, %ar : %s" master..f002985dd1253cef0c8dd98806116eda8a0ca1f2)
echo "before=f002985dd1253cef0c8dd98806116eda8a0ca1f2"
else
mapfile -t COMMITS_ARRAY < <(git log --pretty=format:"'<code>%h</code>' - %an, %ar : %s" fff10e3e2104a741168da6ec3c90b423e08fa767..f002985dd1253cef0c8dd98806116eda8a0ca1f2)
echo "before=fff10e3e2104a741168da6ec3c90b423e08fa767..f002985dd1253cef0c8dd98806116eda8a0ca1f2"
fi
echo "${COMMITS_ARRAY[@]}"
echo "full_list<<EOF"
for COMMIT in "${COMMITS_ARRAY[@]}"; do
echo "$COMMIT"
done
echo "EOF"
LINES_COUNT=${#COMMITS_ARRAY[*]}
if [ "$LINES_COUNT" == "1" ]; then
echo "lines_count=$LINES_COUNT new commit"
else
echo "lines_count=$LINES_COUNT new commits"
fi