forked from bsc-performance-tools/extrae
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate-submodules.sh
More file actions
executable file
·28 lines (25 loc) · 877 Bytes
/
Copy pathupdate-submodules.sh
File metadata and controls
executable file
·28 lines (25 loc) · 877 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
25
26
27
28
#!/bin/sh
git submodule update --init --recursive
cd libaddr2line
# Make sure the latest remote info is available
git fetch origin
# Get the current submodule commit (HEAD)
current_commit=$(git rev-parse HEAD)
# Get the latest commit on the remote branch (e.g., origin/main)
remote_commit=$(git rev-parse origin/main)
if [ "$current_commit" != "$remote_commit" ]; then
echo "Submodule libaddr2line has updates available."
current_branch=$(git branch --show-current)
if [ "$current_branch" = "master" ]; then
echo "Pushing to the master branch is not allowed. To proceed, please create a new branch, re-run 'update-submodules.sh', and open a merge into the main branch."
exit
fi
git pull origin main
cd ..
git add libaddr2line
git commit -m "Updates libaddr2line submodule to latest commit"
git push
else
echo "Submodule libaddr2line is up to date."
exit
fi