[shell-common] Fix PKM command to work with branch names

This commit is contained in:
2021-07-04 13:28:18 +01:00
parent e62a984c4d
commit 89a6556f14

View File

@@ -52,8 +52,9 @@ function commit-pkm() {
echo "No changes detected"
fi
git fetch
if [ $(git rev-parse main) != $(git rev-parse refs/remotes/origin/main) ]; then
git push origin
branch=$(git rev-parse --abbrev-ref HEAD)
if [ $(git rev-parse ${branch}) != $(git rev-parse refs/remotes/origin/${branch}) ]; then
git push origin ${branch}
fi
cd $PREVDIR
fi