This commit is contained in:
pika 2025-07-03 15:56:35 +02:00
parent aeca1cf43f
commit 8d795ad707

View file

@ -530,21 +530,24 @@ __git__() {
;;
esac
[[ -z "$commit_files" ]] && commit_files=.
[[ -z "$commit_message" ]] && commit_message=wip
if [ -n "$commit_files" ] || [ -n "$commit_message" ]; then
echo "${CYAN}No changes on the remote branch. Adding changes and pushing with ${RED}${BOLD}'$commit_message'${NC}${CYAN} commit.${NC}"
echo "${CYAN}No changes on the remote branch. Adding changes and pushing with ${RED}${BOLD}'$commit_message'${NC}${CYAN} commit.${NC}"
[[ -z "$commit_files" ]] && commit_files=.
[[ -z "$commit_message" ]] && commit_message=wip
if (("${#commit_files}" <= 1)); then
git add $commit_files
else
for f in "${commit_files[@]}"; do
git add $f
done
fi
git commit -m "${commit_message:-wip}"
git push
if (("${#commit_files}" <= 1)); then
git add $commit_files
else
for f in "${commit_files[@]}"; do
git add $f
done
fi
git commit -m "${commit_message:-wip}"
git push
else
echo "${RED}${BOLD}There are changes on the remote branch. Please pull the latest changes first.${NC}"
fi