From 89a6556f14522cd04ceea6f9ba19b6010b72c752 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Sun, 4 Jul 2021 13:28:18 +0100 Subject: [PATCH] [shell-common] Fix PKM command to work with branch names --- shell-common/.config/shell-common/functions.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shell-common/.config/shell-common/functions.sh b/shell-common/.config/shell-common/functions.sh index 1063a8e..ae50514 100644 --- a/shell-common/.config/shell-common/functions.sh +++ b/shell-common/.config/shell-common/functions.sh @@ -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