Skip to content

Commit

Permalink
Add support of custom base branch name for 'git release'
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed Jul 10, 2024
1 parent 377087c commit 6050700
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,14 @@ function git_release() {
return 0
fi

if [[ $(\git rev-parse --abbrev-ref HEAD 2>/dev/null) != "master" ]] ; then
local defBranch=$(\git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')

if [[ $(\git rev-parse --abbrev-ref HEAD 2>/dev/null) != "$defBranch" ]] ; then
if ! \git push ; then
return 1
fi

if ! \git checkout master ; then
if ! \git checkout "$defBranch" ; then
return 1
fi
fi
Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -e

################################################################################

VERSION="2.4.6"
VERSION="2.4.7"

################################################################################

Expand Down

0 comments on commit 6050700

Please sign in to comment.