wip
This commit is contained in:
parent
242df2f7e5
commit
5c221b5d63
2 changed files with 10 additions and 3 deletions
|
@ -479,15 +479,21 @@ __git__() {
|
|||
|
||||
# Check if there are any changes on the remote branch
|
||||
if git diff --quiet "$branch" "origin/$branch"; then
|
||||
|
||||
if [ -n $2 ]; then
|
||||
local commit_files="${1:-.}"
|
||||
local commit_message="${2:-wip}"
|
||||
else
|
||||
local commit_message="${1:-wip}"
|
||||
if [ ! -f "$1" ]; then
|
||||
local commit_message="$1"
|
||||
else
|
||||
local commit_files="${1:-.}"
|
||||
local commit_message="wip"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "${CYAN}No changes on the remote branch. Adding changes and pushing with ${RED}${BOLD}'$commit_message'${NC}${CYAN} commit.${NC}"
|
||||
git add "${commit_files:-.}"
|
||||
git add "$commit_files"
|
||||
git commit -m "$commit_message"
|
||||
git push
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue